diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index fc96756..ca38be8 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -2051,7 +2051,8 @@ function drupal_handle_request($test_only = FALSE) { // Exit if we should be in a test environment but aren't. if ($test_only && !drupal_valid_test_ua()) { - throw new AccessDeniedHttpException(); + header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden'); + exit; } // @todo Figure out how best to handle the Kernel constructor parameters. diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index 51a84fd..d8db907 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -255,10 +255,11 @@ function locale_translate_export_form_submit($form, &$form_state) { $writer->writeItems($reader); $writer->close(); - $headers = array( - 'Content-Type' => 'text/plain; charset=utf-8', - ); - return new BinaryFileResponse($uri, 200, $headers, TRUE, 'attachment'); + $response = new BinaryFileResponse($uri); + $response->setContentDisposition('attachment', $filename); + // @todo remove lines below once converted to new routing system. + $response->prepare(Drupal::request()) + ->send(); } else { drupal_set_message('Nothing to export.'); diff --git a/core/modules/openid/openid.inc b/core/modules/openid/openid.inc index 3f55764..2394023 100644 --- a/core/modules/openid/openid.inc +++ b/core/modules/openid/openid.inc @@ -78,7 +78,12 @@ function openid_redirect_http($url, $message) { $sep = (strpos($url, '?') === FALSE) ? '?' : '&'; - return new RedirectResponse($url . $sep . implode('&', $query)); + $response = new RedirectResponse($url . $sep . implode('&', $query)); + // @todo fix this. + $response->prepare(Drupal::request()); + $response->send(); + drupal_session_commit(); + exit; } /** @@ -100,7 +105,12 @@ function openid_redirect($url, $message) { $output .= "\n"; $output .= "\n"; - return new Response($output); + $response = new Response($output); + // @todo fix this. + $response->prepare(Drupal::request()); + $response->send(); + drupal_session_commit(); + exit; } function openid_redirect_form($form, &$form_state, $url, $message) { diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module index 701beb7..c2f3245 100644 --- a/core/modules/overlay/overlay.module +++ b/core/modules/overlay/overlay.module @@ -588,7 +588,10 @@ function overlay_preprocess_page(&$variables) { */ function overlay_deliver_empty_page() { $empty_page = '' . drupal_get_css() . drupal_get_js() . ''; - return new Response($empty_page); + $response = new Response($empty_page); + // @todo remove lines below once converted to new routing system. + $response->send(); + exit; } /** diff --git a/core/modules/system/tests/modules/form_test/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module index 246961e..f171f48 100644 --- a/core/modules/system/tests/modules/form_test/form_test.module +++ b/core/modules/system/tests/modules/form_test/form_test.module @@ -374,9 +374,9 @@ function form_test_permission() { * Form submit handler to return form values as JSON. */ function _form_test_submit_values_json($form, &$form_state) { - // This won't have a proper JSON header, but Drupal doesn't check for that - // anyway so this is fine until it's replaced with a JsonResponse. - return new JsonResponse($form_state['values']); + $response = new JsonResponse($form_state['values']); + // @todo remove once converted to new routing system. + $response->send(); } /** diff --git a/core/modules/xmlrpc/xmlrpc.server.inc b/core/modules/xmlrpc/xmlrpc.server.inc index c0419cf..50f41c7 100644 --- a/core/modules/xmlrpc/xmlrpc.server.inc +++ b/core/modules/xmlrpc/xmlrpc.server.inc @@ -137,7 +137,9 @@ function xmlrpc_server_output($xml) { 'Content-Length' => strlen($xml), 'Content-Type' => 'text/xml' ); - return new Response($xml, 200, $headers); + $response = new Response($xml, 200, $headers); + // @todo remove once converted to new routing system. + $response->send(); } /**