1
0
mirror of https://github.com/danog/file.git synced 2024-11-30 04:19:39 +01:00

Remove bogus array_filter to allow 0 as directory name

This commit is contained in:
Niklas Keller 2017-06-17 23:47:08 +02:00
parent 62428ca0ef
commit 1a46ea9b13
3 changed files with 4 additions and 3 deletions

View File

@ -394,7 +394,7 @@ class EioDriver implements Driver {
if ($recursive) {
$path = str_replace("/", DIRECTORY_SEPARATOR, $path);
$arrayPath = array_filter(explode(DIRECTORY_SEPARATOR, $path));
$arrayPath = explode(DIRECTORY_SEPARATOR, $path);
$tmpPath = "";
$callback = function () use (

View File

@ -352,7 +352,7 @@ class UvDriver implements Driver {
if ($recursive) {
$path = str_replace("/", DIRECTORY_SEPARATOR, $path);
$arrayPath = array_filter(explode(DIRECTORY_SEPARATOR, $path));
$arrayPath = explode(DIRECTORY_SEPARATOR, $path);
$tmpPath = "";
$callback = function () use (

View File

@ -230,7 +230,8 @@ abstract class DriverTest extends TestCase {
yield File\rmdir($dir);
$this->assertNull(yield File\stat($dir));
$dir = "{$fixtureDir}/newdir/with/recursive/creation";
// test for 0, because previous array_filter made that not work
$dir = "{$fixtureDir}/newdir/with/recursive/creation/0/1/2";
yield File\mkdir($dir, 0764, true); // the umask is 022 by default
$stat = yield File\stat($dir);