diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-07-30 01:52:54 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-07-30 01:52:54 +0000 |
commit | 7c9948f0db243d26aebf396c175f9df07e2282bc (patch) | |
tree | 9ababda0869098deea9834a1c2be5e4f745d36e8 /includes | |
parent | cb9869a2dfcbe3d30136c457d0d5fc2b88abc7e5 (diff) | |
download | brdo-7c9948f0db243d26aebf396c175f9df07e2282bc.tar.gz brdo-7c9948f0db243d26aebf396c175f9df07e2282bc.tar.bz2 |
- Patch #855380 by plach: () should be used to lookup the current path alias.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 4 | ||||
-rw-r--r-- | includes/path.inc | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/includes/common.inc b/includes/common.inc index 9be957332..c3d38ef57 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -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_content will be used. + * for the URL. If $options['language'] is omitted, the global $language_url + * 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 diff --git a/includes/path.inc b/includes/path.inc index cb949e3da..e2c3c9095 100644 --- a/includes/path.inc +++ b/includes/path.inc @@ -44,7 +44,7 @@ function drupal_path_initialize() { * found. */ function drupal_lookup_path($action, $path = '', $path_language = NULL) { - global $language_content; + global $language_url; // Use the advanced drupal_static() pattern, since this is called very often. static $drupal_static_fast; if (!isset($drupal_static_fast)) { @@ -71,7 +71,11 @@ function drupal_lookup_path($action, $path = '', $path_language = NULL) { } } - $path_language = $path_language ? $path_language : $language_content->language; + // If no language is explicitly specified we default to the current URL + // language. If we used a language different from the one conveyed by the + // requested URL, we might end up being unable to check if there is a path + // alias matching the URL path. + $path_language = $path_language ? $path_language : $language_url->language; if ($action == 'wipe') { $cache = array(); |