Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.4] Fixed Filesystem::files bug #19157

Merged
merged 1 commit into from
May 11, 2017
Merged

[5.4] Fixed Filesystem::files bug #19157

merged 1 commit into from
May 11, 2017

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