Skip to content

Conversation

@thetomcake
Copy link
Contributor

Filesystem::files uses glob($directory.'/*');

On Windows this returns a / rather than a \ on the last directory separator and seems to be an oddity in the php core glob() function.

Example using glob($directory.'/*');

>>> $path = 'C:\filestest';
>>> File::files($path)
=> [
     "C:\filestest/testfile1.txt",
     "C:\filestest/testfile2.txt",
     "C:\filestest/testfile3.txt",
   ]

Example using glob($directory.DIRECTORY_SEPARATOR.'*');

>>> $path = 'C:\filestest';
>>> File::files($path)
=> [
     "C:\filestest\testfile1.txt",
     "C:\filestest\testfile2.txt",
     "C:\filestest\testfile3.txt",
   ]

@tillkruss tillkruss changed the title Fixed Filesystem::files bug [5.4] Fixed Filesystem::files bug May 11, 2017
@taylorotwell taylorotwell merged commit 84946b7 into laravel:5.4 May 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants