Skip to content
New issue

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

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

Already on GitHub? # to your account

[11.x] Fix join_paths issue with segment '0' #51649

Merged
merged 1 commit into from
May 30, 2024

Conversation

imanghafoori1
Copy link
Contributor

@imanghafoori1 imanghafoori1 commented May 30, 2024

since the join_paths() function internally uses the empty function to filter out empty strings and prevent double slashes in the end result, it also filters out a perfectly valid path segment with the value of '0'.
empty('0'); // true
empty(''); // true

a folder with the name "0" is perfectly valid in Windows and UNIX, so there is no reason to delete 0 from segments while joining them.

image

Backward compatibility:

This is not in theory backward compatible but statistically very rare to happen and very rare for an application to rely on this flaw to work correctly.

@imanghafoori1 imanghafoori1 changed the title [11.x] fix join_paths issue with segment '0' [11.x] Fix join_paths issue with segment '0' May 30, 2024
@taylorotwell taylorotwell merged commit 7aab6b9 into laravel:11.x May 30, 2024
28 checks passed
@imanghafoori1 imanghafoori1 deleted the fix_join_paths branch May 30, 2024 15:55
@imanghafoori1 imanghafoori1 restored the fix_join_paths branch May 30, 2024 16:22
@imanghafoori1 imanghafoori1 deleted the fix_join_paths branch May 30, 2024 22:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants