diff --git a/core/modules/system/src/Tests/Routing/DestinationTest.php b/core/modules/system/src/Tests/Routing/DestinationTest.php index a590d62..56a7edf 100644 --- a/core/modules/system/src/Tests/Routing/DestinationTest.php +++ b/core/modules/system/src/Tests/Routing/DestinationTest.php @@ -72,9 +72,9 @@ public function testDestination() { $this->assertIdentical($test_case['output'], $post_output, $test_case['message']); } - // Make sure that 404 pages do not populate $_GET['destination'] with - // external URLs. - \Drupal::configFactory()->getEditable('system.site')->set('page.404', 'system-test/get-destination')->save(); + // Make sure that 404 pages do not populate $_GET['_exception_location'] + // with external URLs. + \Drupal::configFactory()->getEditable('system.site')->set('page.404', 'system-test/get-exception-location')->save(); $this->drupalGet('http://example.com', ['external' => FALSE]); $this->assertResponse(404); $this->assertIdentical(Url::fromRoute('')->toString(), $this->getRawContent(), 'External URL is not allowed on 404 pages.'); diff --git a/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php b/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php index 5ac7ca0..0fab6aa 100644 --- a/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php +++ b/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php @@ -130,6 +130,20 @@ public function getDestination(Request $request) { } /** + * Controller to return $_GET['_exception_location'] for testing. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * The request. + * + * @return \Symfony\Component\HttpFoundation\Response + * The response. + */ + public function getExceptionLocation(Request $request) { + $response = new Response($request->query->get('_exception_location')); + return $response; + } + + /** * Controller to return $_REQUEST['destination'] for testing. * * @param \Symfony\Component\HttpFoundation\Request $request diff --git a/core/modules/system/tests/modules/system_test/system_test.routing.yml b/core/modules/system/tests/modules/system_test/system_test.routing.yml index ecb9921..ba22633 100644 --- a/core/modules/system/tests/modules/system_test/system_test.routing.yml +++ b/core/modules/system/tests/modules/system_test/system_test.routing.yml @@ -116,6 +116,13 @@ system_test.get_destination: requirements: _access: 'TRUE' +system_test.get_exception_location: + path: '/system-test/get-exception-location' + defaults: + _controller: '\Drupal\system_test\Controller\SystemTestController::getExceptionLocation' + requirements: + _access: 'TRUE' + system_test.permission_dependent_content: path: '/system-test/permission-dependent-content' defaults: