Skip to content

[DependencyInjection] Fix "url" env var processor behavior when the url has no path #40629

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

Merged
merged 1 commit into from
Mar 31, 2021

Conversation

fancyweb
Copy link
Contributor

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

Before:

MY_URL_ENV_VAR=http://symfony.com
%env(key:path:url:MY_URL_ENV_VAR)% --> false

After:

MY_URL_ENV_VAR=http://symfony.com
%env(key:path:url:MY_URL_ENV_VAR)% --> null

Returning false for the path prevents me from using the default env var processor that is triggered only for '' and null.
(%env(default:my_fallback_param:key:path:url:MY_URL_ENV_VAR)%)

BTW, with PHP 8, it actually works because substr(null, 1) behavior changed (see https://3v4l.org/oHf6l).

@fancyweb fancyweb changed the base branch from 5.x to 4.4 March 29, 2021 13:51
@Nyholm
Copy link
Member

Nyholm commented Mar 31, 2021

Great, thank you Thomas

@Nyholm Nyholm merged commit 990b51b into symfony:4.4 Mar 31, 2021
@fancyweb fancyweb deleted the di-fix-url-env-var-processor branch April 1, 2021 07:11
This was referenced May 1, 2021
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.

5 participants