diff --git a/core/modules/system/src/Controller/Http4xxController.php b/core/modules/system/src/Controller/Http4xxController.php index 0dae4e8..01101af 100644 --- a/core/modules/system/src/Controller/Http4xxController.php +++ b/core/modules/system/src/Controller/Http4xxController.php @@ -37,11 +37,12 @@ public function on403() { '#markup' => $this->t('You are not authorized to access this page.'), '#attached' => array( 'drupalSettings' => [ - // 403 page is not marked as an administrative page by - // \Drupal::service('router.admin_context')->isAdminRoute() function - // in order to use the frontend theme. Since JavaScript relies on a - // proper separation of admin pages, it needs to know this is an - // actual administrative page. + // The 403 page is not marked as an administrative page by + // \Drupal::service('router.admin_context')->isAdminRoute() in order + // to use the frontend theme. Since JavaScript relies on a proper + // separation of admin pages, it needs to know this is an + // administrative page, in order to prevent the "back to site" + // functionality from saving this page as the last non-admin page. 'path' => ['currentPathIsAdmin' => TRUE], ], ), @@ -59,11 +60,12 @@ public function on404() { '#markup' => $this->t('The requested page could not be found.'), '#attached' => array( 'drupalSettings' => [ - // 404 page is not marked as an administrative page by - // \Drupal::service('router.admin_context')->isAdminRoute() function - // in order to use the frontend theme. Since JavaScript relies on a - // proper separation of admin pages, it needs to know this is an - // actual administrative page. + // The 404 page is not marked as an administrative page by + // \Drupal::service('router.admin_context')->isAdminRoute() in order + // to use the frontend theme. Since JavaScript relies on a proper + // separation of admin pages, it needs to know this is an + // administrative page, in order to prevent the "back to site" + // functionality from saving this page as the last non-admin page. 'path' => ['currentPathIsAdmin' => TRUE], ], ),