Mercurial > hg > cmmr2012-drupal-site
diff core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
line wrap: on
line diff
--- a/core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php Thu Feb 28 13:11:55 2019 +0000 +++ b/core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php Thu May 09 15:34:47 2019 +0100 @@ -10,7 +10,6 @@ use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; -use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\KernelEvents; /** @@ -72,7 +71,7 @@ * @see \Drupal\Core\Authentication\AuthenticationProviderInterface::authenticate() */ public function onKernelRequestAuthenticate(GetResponseEvent $event) { - if ($event->getRequestType() === HttpKernelInterface::MASTER_REQUEST) { + if ($event->isMasterRequest()) { $request = $event->getRequest(); if ($this->authenticationProvider->applies($request)) { $account = $this->authenticationProvider->authenticate($request); @@ -93,7 +92,7 @@ * The request event. */ public function onKernelRequestFilterProvider(GetResponseEvent $event) { - if (isset($this->filter) && $event->getRequestType() === HttpKernelInterface::MASTER_REQUEST) { + if (isset($this->filter) && $event->isMasterRequest()) { $request = $event->getRequest(); if ($this->authenticationProvider->applies($request) && !$this->filter->appliesToRoutedRequest($request, TRUE)) { throw new AccessDeniedHttpException('The used authentication method is not allowed on this route.'); @@ -112,7 +111,7 @@ * The exception event. */ public function onExceptionSendChallenge(GetResponseForExceptionEvent $event) { - if (isset($this->challengeProvider) && $event->getRequestType() === HttpKernelInterface::MASTER_REQUEST) { + if (isset($this->challengeProvider) && $event->isMasterRequest()) { $request = $event->getRequest(); $exception = $event->getException(); if ($exception instanceof AccessDeniedHttpException && !$this->authenticationProvider->applies($request) && (!isset($this->filter) || $this->filter->appliesToRoutedRequest($request, FALSE))) { @@ -129,7 +128,7 @@ * * @param \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event */ - public function _onExceptionAccessDenied(GetResponseForExceptionEvent $event) { + public function onExceptionAccessDenied(GetResponseForExceptionEvent $event) { if (isset($this->filter) && $event->isMasterRequest()) { $request = $event->getRequest(); $exception = $event->getException(); @@ -152,7 +151,7 @@ // Access check must be performed after routing. $events[KernelEvents::REQUEST][] = ['onKernelRequestFilterProvider', 31]; $events[KernelEvents::EXCEPTION][] = ['onExceptionSendChallenge', 75]; - $events[KernelEvents::EXCEPTION][] = ['_onExceptionAccessDenied', 80]; + $events[KernelEvents::EXCEPTION][] = ['onExceptionAccessDenied', 80]; return $events; }