Security update for Core, with self-updated composer
[yaffs-website] / web / core / lib / Drupal / Core / EventSubscriber / DefaultExceptionHtmlSubscriber.php
index 38cb8950d00273dfb486d48342942c078d207760..f168a02caddf12c99e55bbd4836a334a459f981e 100644 (file)
@@ -79,6 +79,18 @@ class DefaultExceptionHtmlSubscriber extends HttpExceptionSubscriberBase {
     return ['html'];
   }
 
+  /**
+   * Handles a 4xx error for HTML.
+   *
+   * @param \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event
+   *   The event to process.
+   */
+  public function on4xx(GetResponseForExceptionEvent $event) {
+    if (($exception = $event->getException()) && $exception instanceof HttpExceptionInterface) {
+      $this->makeSubrequest($event, '/system/4xx', $exception->getStatusCode());
+    }
+  }
+
   /**
    * Handles a 401 error for HTML.
    *