diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-07-16 02:37:06 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-07-16 02:37:06 +0000 |
commit | 2ad0a2c1f79b15ab74c734424a9d4a4d388028c2 (patch) | |
tree | ab48b7e5fd849d0b568e5829250aadbe2f274e07 /includes | |
parent | da75021509b179b6c42f633d16cd09a7e6ce339d (diff) | |
download | brdo-2ad0a2c1f79b15ab74c734424a9d4a4d388028c2.tar.gz brdo-2ad0a2c1f79b15ab74c734424a9d4a4d388028c2.tar.bz2 |
- Patch #684982 by plach: audit of global language variable use.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/includes/common.inc b/includes/common.inc index cd08238bd..b2cccec1e 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1551,8 +1551,8 @@ function filter_xss_bad_protocol($string, $decode = TRUE) { * Arbitrary elements may be added using the $args associative array. */ function format_rss_channel($title, $link, $description, $items, $langcode = NULL, $args = array()) { - global $language; - $langcode = $langcode ? $langcode : $language->language; + global $language_content; + $langcode = $langcode ? $langcode : $language_content->language; $output = "<channel>\n"; $output .= ' <title>' . check_plain($title) . "</title>\n"; @@ -1997,8 +1997,8 @@ function format_username($account) { * - 'external': Whether the given path is an external URL. * - 'language': An optional language object. If the path being linked to is * internal to the site, $options['language'] is used to look up the alias - * for the URL. If $options['language'] is omitted, the global $language - * will be used. + * for the URL. If $options['language'] is omitted, the global + * $language_content will be used. * - 'https': Whether this URL should point to a secure location. If not * defined, the current scheme is used, so the user stays on http or https * respectively. TRUE enforces HTTPS and FALSE enforces HTTP, but HTTPS can @@ -5342,9 +5342,12 @@ function drupal_render_cid_parts($granularity = NULL) { global $theme, $base_root, $user; $cid_parts[] = $theme; - if (module_exists('locale')) { - global $language; - $cid_parts[] = $language->language; + // If Locale is enabled but we have only one language we do not need it as cid + // part. + if (drupal_multilingual()) { + foreach (language_types_configurable() as $language_type) { + $cid_parts[] = $GLOBALS[$language_type]->language; + } } if (!empty($granularity)) { |