106c106,123 < list($prefix, $options) = _globalredirect_prefix_options(); --- > // Establish the language prefix that should be used, ie. the one that > // drupal_goto() would use > $options = array( > 'fragment' => '', > 'query' => '', > 'absolute' => FALSE, > 'alias' => FALSE, > 'prefix' => '', > 'external' => FALSE, > ); > if (function_exists('language_url_rewrite')) { > // Note that language_url_rewrite() takes path (by reference) as the > // first argument but does not use it at all > $path = $_REQUEST['q']; > language_url_rewrite($path, $options); > } > $prefix = rtrim($options['prefix'], '/'); > 165,168c182 < if (str_replace($prefix . $alias, '', $_REQUEST['q']) != '/') { < drupal_goto($prefix . $alias, $query_string, NULL, 301); < } < if ($redirect_slash) { --- > if (str_replace($prefix . $alias, '', $_REQUEST['q']) != '/' || $redirect_slash) { 184,224d197 < < function _globalredirect_prefix_options() { < // @see http://drupal.org/node/422742 < // Establish the language prefix that should be used, ie. the one that < // drupal_goto() would use < $options = array( < 'fragment' => '', < 'query' => '', < 'absolute' => FALSE, < 'alias' => FALSE, < 'prefix' => '', < 'external' => FALSE, < ); < < $path = $_REQUEST['q']; < if (function_exists('language_url_rewrite')) { < // Note that language_url_rewrite() takes path (by reference) as the < // first argument but does not use it at all < language_url_rewrite($path, $options); < } < $prefix = rtrim($options['prefix'], '/'); < < // Check if site is configured for "Path prefix only" < // (may also be necessary for path prefix with language fallback - but that is untested) < if (variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE)) { < if (preg_match("@^node/(\d*)$@", $path, $regs)) { < $n = node_load($regs[1]); < // Check the node language < $language_code = ($n->language) ? $n->language : ''; < // Get the prefix for the language < $languages = language_list(); < if ($languages[$language_code]->enabled) { < $prefix = $languages[$language_code]->prefix; < $options['language']->language = $language_code; < } < } < } < return array($prefix, $options); < } < <