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:
Fabien Potencier 2016-08-23 09:54:14 -07:00
commit a45be6d82a
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ class BasicAuthenticationListener implements ListenerInterface
{
$request = $event->getRequest();
if (false === $username = $request->headers->get('PHP_AUTH_USER', false)) {
if (null === $username = $request->headers->get('PHP_AUTH_USER')) {
return;
}