Skip to content

Conversation

@vlakoff
Copy link
Contributor

@vlakoff vlakoff commented Dec 15, 2021

#40013 was incorrect, because when provided argument was '0',
we were appending $path (i.e. '0') instead of DIRECTORY_SEPARATOR.$path (i.e. '/0').

To summarize the behavior after this PR:

argument appended string
'foo' '/foo'
'0' '/0'
'' (default) ''

In addition, as I'm using a loose comparison, it supports the following cases (they are not supported nor expected, though it doesn't harm to work better with them):

argument appended string
null ''
false ''

@taylorotwell taylorotwell merged commit 96d2b48 into laravel:master Dec 15, 2021
@vlakoff vlakoff deleted the storagePath branch December 15, 2021 17:49
@4m1n0s
Copy link
Contributor

4m1n0s commented Jan 26, 2022

i think this fix must be applied to other functions too such as: path, basePath, bootstrapPath, configPath.....

@vlakoff
Copy link
Contributor Author

vlakoff commented Jan 26, 2022

As a reminder, I used $path != '' which is equivalent to (string) $path !== ''.
I choosed the former because it is shorter, but the latter might be preferable so people are not inclined to think that $path != '' should be replaced with with $path !== ''.

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.

3 participants