update v1.0.4
This commit is contained in:
10
vendor/league/flysystem/src/Util.php
vendored
10
vendor/league/flysystem/src/Util.php
vendored
@@ -17,9 +17,7 @@ class Util
|
||||
public static function pathinfo($path)
|
||||
{
|
||||
$pathinfo = pathinfo($path) + compact('path');
|
||||
$pathinfo['dirname'] = array_key_exists('dirname', $pathinfo)
|
||||
? static::normalizeDirname($pathinfo['dirname'])
|
||||
: '';
|
||||
$pathinfo['dirname'] = static::normalizeDirname($pathinfo['dirname']);
|
||||
|
||||
return $pathinfo;
|
||||
}
|
||||
@@ -65,7 +63,7 @@ class Util
|
||||
$result = [];
|
||||
|
||||
foreach ($map as $from => $to) {
|
||||
if (! isset($object[$from])) {
|
||||
if ( ! isset($object[$from])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -161,7 +159,7 @@ class Util
|
||||
{
|
||||
$mimeType = MimeType::detectByContent($content);
|
||||
|
||||
if (empty($mimeType) || $mimeType === 'text/plain') {
|
||||
if (empty($mimeType) || in_array($mimeType, ['text/plain', 'application/x-empty'])) {
|
||||
$extension = pathinfo($path, PATHINFO_EXTENSION);
|
||||
|
||||
if ($extension) {
|
||||
@@ -281,7 +279,7 @@ class Util
|
||||
|
||||
$parent = $object['dirname'];
|
||||
|
||||
while (! empty($parent) && ! in_array($parent, $directories)) {
|
||||
while ( ! empty($parent) && ! in_array($parent, $directories)) {
|
||||
$directories[] = $parent;
|
||||
$parent = static::dirname($parent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user