minor #19499 [SecurityBundle] BasicAuthenticationListener: simpler getting value from Request (MacDada)
This PR was merged into the 2.7 branch.
Discussion
----------
[SecurityBundle] BasicAuthenticationListener: simpler getting value from Request
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Unless I'm mistaken, the default `null` should be OK. If it's not, I will create a new PR with a test proving that `false` or other "special" value must be used.
Commits
-------
d67f090
SecurityBundle:BasicAuthenticationListener: removed a default argument on getting a header value
This commit is contained in:
commit
a45be6d82a
@ -56,7 +56,7 @@ class BasicAuthenticationListener implements ListenerInterface
|
|||||||
{
|
{
|
||||||
$request = $event->getRequest();
|
$request = $event->getRequest();
|
||||||
|
|
||||||
if (false === $username = $request->headers->get('PHP_AUTH_USER', false)) {
|
if (null === $username = $request->headers->get('PHP_AUTH_USER')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user