Unverified Commit 85ee5e16 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3209618 by catch, longwave, Neslee Canil Pinto, daffie, andypost, Gábor...

Issue #3209618 by catch, longwave, Neslee Canil Pinto, daffie, andypost, Gábor Hojtsy: [Symfony 6] Symfony\Component\HttpKernel\Event\KernelEvent::isMasterRequest() is deprecated, use isMainRequest() instead
parent b50a4ddb
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
use Drupal\Core\Extension\ExtensionDiscovery;
use Drupal\Core\File\MimeType\MimeTypeGuesser;
use Drupal\Core\Http\InputBag;
use Drupal\Core\Http\KernelEvent;
use Drupal\Core\Http\TrustedHostsRequestFactory;
use Drupal\Core\Installer\InstallerKernel;
use Drupal\Core\Installer\InstallerRedirectTrait;
@@ -39,6 +40,10 @@
use TYPO3\PharStreamWrapper\Behavior as PharStreamWrapperBehavior;
use TYPO3\PharStreamWrapper\PharStreamWrapper;

// @todo https://www.drupal.org/project/drupal/issues/3197482 Remove this class
//   alias once Drupal is running Symfony 5.3 or higher.
class_alias(KernelEvent::class, 'Symfony\Component\HttpKernel\Event\KernelEvent', TRUE);

/**
 * The DrupalKernel class is the core of Drupal itself.
 *
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ public function __construct(AccountInterface $current_user) {
   *   The event to process.
   */
  public function onRespond(ResponseEvent $event) {
    if (!$event->isMasterRequest()) {
    if (!$event->isMainRequest()) {
      return;
    }

+4 −4
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ public function __construct(AuthenticationProviderInterface $authentication_prov
   * @see \Drupal\Core\Authentication\AuthenticationProviderInterface::authenticate()
   */
  public function onKernelRequestAuthenticate(RequestEvent $event) {
    if ($event->isMasterRequest()) {
    if ($event->isMainRequest()) {
      $request = $event->getRequest();
      if ($this->authenticationProvider->applies($request)) {
        $account = $this->authenticationProvider->authenticate($request);
@@ -90,7 +90,7 @@ public function onKernelRequestAuthenticate(RequestEvent $event) {
   *   The request event.
   */
  public function onKernelRequestFilterProvider(RequestEvent $event) {
    if (isset($this->filter) && $event->isMasterRequest()) {
    if (isset($this->filter) && $event->isMainRequest()) {
      $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.');
@@ -109,7 +109,7 @@ public function onKernelRequestFilterProvider(RequestEvent $event) {
   *   The exception event.
   */
  public function onExceptionSendChallenge(ExceptionEvent $event) {
    if (isset($this->challengeProvider) && $event->isMasterRequest()) {
    if (isset($this->challengeProvider) && $event->isMainRequest()) {
      $request = $event->getRequest();
      $exception = $event->getThrowable();
      if ($exception instanceof AccessDeniedHttpException && !$this->authenticationProvider->applies($request) && (!isset($this->filter) || $this->filter->appliesToRoutedRequest($request, FALSE))) {
@@ -127,7 +127,7 @@ public function onExceptionSendChallenge(ExceptionEvent $event) {
   * @param \Symfony\Component\HttpKernel\Event\ExceptionEvent $event
   */
  public function onExceptionAccessDenied(ExceptionEvent $event) {
    if (isset($this->filter) && $event->isMasterRequest()) {
    if (isset($this->filter) && $event->isMainRequest()) {
      $request = $event->getRequest();
      $exception = $event->getThrowable();
      if ($exception instanceof AccessDeniedHttpException && $this->authenticationProvider->applies($request) && !$this->filter->appliesToRoutedRequest($request, TRUE)) {
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ class ClientErrorResponseSubscriber implements EventSubscriberInterface {
   *   The event to process.
   */
  public function onRespond(ResponseEvent $event) {
    if (!$event->isMasterRequest()) {
    if (!$event->isMainRequest()) {
      return;
    }

+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ public function onKernelException(ExceptionEvent $event) {
   */
  public function onKernelResponse(ResponseEvent $event) {
    $response = $event->getResponse();
    if ($response instanceof EnforcedResponse && $event->isMasterRequest()) {
    if ($response instanceof EnforcedResponse && $event->isMainRequest()) {
      $event->setResponse($response->getResponse());
    }
  }
Loading