--- includes/common.inc.orig 2010-08-31 13:56:21.000000000 -0400 +++ includes/common.inc 2010-08-31 13:56:53.000000000 -0400 @@ -1331,7 +1331,17 @@ function url($path = NULL, $query = NULL $clean_url = (bool)variable_get('clean_url', '0'); } - $base = ($absolute ? $base_url . '/' : base_path()); + // Preserve the original path before aliasing. + $original_path = $path; + // Prevent the global $base_url from being altered. + $current_base_url = $base_url; + + if (function_exists('custom_url_rewrite_outbound')) { + // Modules may alter outbound links by reference. + custom_url_rewrite_outbound($path, $query, $fragment, $absolute, $current_base_url, $original_path); + } + + $base = ($absolute ? $current_base_url . '/' : base_path()); // The special path '' links to the default front page. if (!empty($path) && $path != '') {