-
Notifications
You must be signed in to change notification settings - Fork 11k
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.8] BUG: Fix quoted environment variable parsing #27691
[5.8] BUG: Fix quoted environment variable parsing #27691
Conversation
Workaround in
|
I also propose adding single quotes support: BROADCAST_DRIVER="'null'" <env name="BROADCAST_DRIVER" value="'null'" /> if (($valueLength = strlen($value)) > 1 && $value[0] === '"' && $value[$valueLength - 1] === '"') {
return substr($value, 1, -1);
} ↓ if (($valueLength = strlen($value)) > 1 && ($value[0] === '"' && $value[$valueLength - 1] === '"' || $value[0] === "'" && $value[$valueLength - 1] === "'")) {
return substr($value, 1, -1);
} |
Is this something you could add a test for? |
Added test. |
@GrahamCampbell need your feedback here. |
Why did you not keep the same stripping logic we had before? Why did you change to this regular expression? The logic appears a bit different in that it only checks if it begins with quotes and doesn't check if it ends in a quote? |
@taylorotwell |
I think going forward into future Laravel versions we may want to consider offering an alternative to "null" for these drivers. Even if we still support null, having another name that doesn't have this kinds of problems would be nice. |
how about 'none' or.. 'nullish' :) |
This is not broken. |
You should not have both single and double quotes. |
@mpyw You should instead have:
or
Do not use both quotes. |
|
For specifying
NullBroadcastDriver
in Laravel 5.7, we need to explicitly quote value like this:In Laravel 5.8, I got this error:
According to @GrahamCampbell's commit #27462:
I think phpdotenv can natively handle quoted values, however,
NullBroadcastDriver
expects PHP stringstring(4) "null"
on configuration, notstring(6) ""null""
orstring(6) "'null'"
.