Update src/Symfony/Component/Security/Http/Firewall/UsernamePasswordFormAuthenticationListener.php

Better consistency in request method checking (See L.58)
This commit is contained in:
nervo 2012-09-23 10:54:29 +03:00
parent e9b6a12baf
commit e0c001b772

View File

@ -67,7 +67,7 @@ class UsernamePasswordFormAuthenticationListener extends AbstractAuthenticationL
*/
protected function attemptAuthentication(Request $request)
{
if ($this->options['post_only'] && 'post' !== strtolower($request->getMethod())) {
if ($this->options['post_only'] && !$request->isMethod('post')) {
if (null !== $this->logger) {
$this->logger->debug(sprintf('Authentication method not supported: %s.', $request->getMethod()));
}