diff --git a/core/lib/Drupal/Core/Ajax/AjaxResponse.php b/core/lib/Drupal/Core/Ajax/AjaxResponse.php index 12250b9..3769750 100644 --- a/core/lib/Drupal/Core/Ajax/AjaxResponse.php +++ b/core/lib/Drupal/Core/Ajax/AjaxResponse.php @@ -66,12 +66,13 @@ protected function ajaxRender($request) { // added during this request to be loaded by the page. We only want to send // back files that the page hasn't already loaded, so we implement simple // diffing logic using array_diff_key(). + $ajax_page_state = $request->request->get('ajax_page_state'); foreach (array('css', 'js') as $type) { // It is highly suspicious if $_POST['ajax_page_state'][$type] is empty, // since the base page ought to have at least one JS file and one CSS file // loaded. It probably indicates an error, and rather than making the page // reload all of the files, instead we return no new files. - if (empty($request->parameters['ajax_page_state'][$type])) { + if (empty($ajax_page_state[$type])) { $items[$type] = array(); } else { @@ -90,7 +91,7 @@ protected function ajaxRender($request) { } } // Ensure that the page doesn't reload what it already has. - $items[$type] = array_diff_key($items[$type], $request->parameters['ajax_page_state'][$type]); + $items[$type] = array_diff_key($items[$type], $ajax_page_state[$type]); } }