diff --git a/globalredirect.module b/globalredirect.module index e04e4c1..5b4bfe8 100644 --- a/globalredirect.module +++ b/globalredirect.module @@ -191,6 +191,12 @@ function globalredirect_init() { $langcode = isset($options['language']->language) ? $options['language']->language : ''; $alias = drupal_get_path_alias($current_path, $langcode); + //if there was no alias and we already have the langcode as a prefix then strip it. + if(strpos ($alias, $langcode . '/') === 0) + { + $alias = substr($alias, strlen($langcode) + 1); + } + // Modules may alter outbound links by reference drupal_alter('url_outbound', $alias, $options, $current_path);