summaryrefslogtreecommitdiff
path: root/modules/locale/locale.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/locale/locale.module')
-rw-r--r--modules/locale/locale.module11
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index 92147aa8a..46a3f86db 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -941,7 +941,11 @@ function locale_block_view($type) {
function locale_url_outbound_alter(&$path, &$options, $original_path) {
// Only modify internal URLs.
if (!$options['external'] && drupal_multilingual()) {
- static $callbacks;
+ static $drupal_static_fast;
+ if (!isset($drupal_static_fast)) {
+ $drupal_static_fast['callbacks'] = &drupal_static(__FUNCTION__);
+ }
+ $callbacks = &$drupal_static_fast['callbacks'];
if (!isset($callbacks)) {
$callbacks = array();
@@ -969,6 +973,11 @@ function locale_url_outbound_alter(&$path, &$options, $original_path) {
foreach ($callbacks as $callback) {
$callback($path, $options);
}
+
+ // No language dependent path allowed in this mode.
+ if (empty($callbacks)) {
+ unset($options['language']);
+ }
}
}