diff --git a/core/includes/common.inc b/core/includes/common.inc index bffacfa..793e2bc 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -443,7 +443,7 @@ function drupal_get_feeds($delimiter = "\n") { function drupal_get_query_parameters(array $query = NULL, array $exclude = array(), $parent = '') { // Set defaults, if none given. if (!isset($query)) { - $query = $_GET; + $query = Drupal::request()->query->all(); } // If $exclude is empty, there is nothing to filter. if (empty($exclude)) { @@ -525,9 +525,9 @@ function drupal_get_destination() { if (isset($destination)) { return $destination; } - - if (isset($_GET['destination'])) { - $destination = array('destination' => $_GET['destination']); + $request = Drupal::request(); + if ($request->query->has('destination')) { + $destination = array('destination' => $request->query->get('destination')); } else { $path = current_path(); @@ -4875,7 +4875,7 @@ function show(&$element) { * @see drupal_render_cache_set() */ function drupal_render_cache_get($elements) { - if (!in_array($_SERVER['REQUEST_METHOD'], array('GET', 'HEAD')) || !$cid = drupal_render_cid_create($elements)) { + if (!Drupal::request()->isMethodSafe() || !$cid = drupal_render_cid_create($elements)) { return FALSE; } $bin = isset($elements['#cache']['bin']) ? $elements['#cache']['bin'] : 'cache'; @@ -4907,7 +4907,7 @@ function drupal_render_cache_get($elements) { */ function drupal_render_cache_set(&$markup, $elements) { // Create the cache ID for the element. - if (!in_array($_SERVER['REQUEST_METHOD'], array('GET', 'HEAD')) || !$cid = drupal_render_cid_create($elements)) { + if (!Drupal::request()->isMethodSafe() || !$cid = drupal_render_cid_create($elements)) { return FALSE; }