--- common.inc 2008-01-22 18:36:49.000000000 +0900 +++ common.inc 2008-06-11 15:03:37.000000000 +0900 @@ -1186,11 +1186,25 @@ $clean_url = (bool)variable_get('clean_url', '0'); } - $base = ($absolute ? $base_url . '/' : base_path()); + // Preserve the original path before aliasing. + $original_path = $path; // The special path '' links to the default front page. - if (!empty($path) && $path != '') { + if ($path == '') { + $path = ''; + } + elseif (!empty($path)) { $path = drupal_get_path_alias($path); + } + + if (function_exists('custom_url_rewrite_outbound')) { + // Modules may alter outbound links by reference. + custom_url_rewrite_outbound($path, $query, $fragment, $absolute, $base_url, $original_path); + } + + $base = ($absolute ? $base_url . '/' : base_path()); + + if (!empty($path)) { $path = drupal_urlencode($path); if (!$clean_url) { if (isset($query)) {