diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/includes/common.inc b/includes/common.inc index 34758a397..b8900736e 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1314,27 +1314,27 @@ function url($path = NULL, $options = array()) { // The base_url might be rewritten from the language rewrite in domain mode. $options['base_url'] = $base_url; } - $base = $options['absolute'] ? $options['base_url'] .'/' : base_path(); // Preserve the original path before aliasing. $original_path = $path; // The special path '<front>' links to the default front page. - if (!empty($path) && $path != '<front>') { - if (!$options['alias']) { - $path = drupal_get_path_alias($path, isset($options['language']) ? $options['language']->language : ''); - } - if (function_exists('custom_url_rewrite_outbound')) { - // Modules may alter outbound links by reference. - custom_url_rewrite_outbound($path, $options, $original_path); - } - $path = drupal_urlencode($options['prefix'] . $path); + if ($path == '<front>') { + $path = ''; } - else { - // Will be empty if there is no language prefix. - $path = trim($options['prefix'], '/'); + elseif (!empty($path) && !$options['alias']) { + $path = drupal_get_path_alias($path, isset($options['language']) ? $options['language']->language : ''); } + if (function_exists('custom_url_rewrite_outbound')) { + // Modules may alter outbound links by reference. + custom_url_rewrite_outbound($path, $options, $original_path); + } + + $base = $options['absolute'] ? $options['base_url'] .'/' : base_path(); + $prefix = empty($path) ? rtrim($options['prefix'], '/') : $options['prefix']; + $path = drupal_urlencode($prefix . $path); + if ($clean_url) { // With Clean URLs. if ($options['query']) { |