diff --git a/core/includes/common.inc b/core/includes/common.inc index 19ad5f1..45a29b2 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -539,34 +539,6 @@ function drupal_get_destination() { } /** - * Utility method to get the normalized type of the current request. - * - * Fetches the ContentNegotiation and Request objects from the current container - * and returns the associated request content type. The normalized type is a - * short, lowercase version of the format, such as 'html', 'json' or 'atom'. - * - * @return string|false - * The request type, or false if the objects are unavailable. - */ -function drupal_get_request_content_type() { - $type = &drupal_static(__FUNCTION__); - - if (isset($type)) { - return $type; - } - else { - $container = drupal_container(); - if ($container->has('request') && $container->has('content_negotiation')) { - $type = $container->get('content_negotiation')->getContentType($container->get('request')); - } - else { - $type = FALSE; - } - } - return $type; -} - -/** * Parses a system URL string into an associative array suitable for url(). * * This function should only be used for URLs that have been generated by the @@ -3927,7 +3899,10 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS uasort($items, 'drupal_sort_css_js'); // Don't add settings if there is no other JavaScript on the page, unless // this is an AJAX request. - if (!empty($items['settings']) || drupal_get_request_content_type() == 'ajax') { + // @todo Clean up container call. + $container = drupal_container(); + $type = $container->get('content_negotiation')->getContentType($container->get('request')); + if (!empty($items['settings']) || $type == 'ajax') { global $theme_key; // Provide the page with information about the theme that's used, so that // a later AJAX request can be rendered using the same theme.