Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.756.2.73
diff -u -p -r1.756.2.73 common.inc
--- includes/common.inc	6 Nov 2009 08:34:58 -0000	1.756.2.73
+++ includes/common.inc	10 Nov 2009 21:40:19 -0000
@@ -1441,6 +1441,16 @@ function url($path = NULL, $options = ar
         $options['fragment'] = '#'. $old_fragment;
       }
     }
+    // Modules may alter outbound links by reference.
+    static $rewrite_external;
+    if (!isset($rewrite_external)) {
+      $drupal_non_critical_api_changes = variable_get('drupal_non_critical_api_changes', array());
+      $rewrite_external = !empty($drupal_non_critical_api_changes['custom_url_rewrite_outbound']['include_external']);
+    }
+    if ($rewrite_external && function_exists('custom_url_rewrite_outbound')) {
+      $original_path = $path;
+      custom_url_rewrite_outbound($path, $options, $original_path);
+    }
     // Append the query.
     if ($options['query']) {
       $path .= (strpos($path, '?') !== FALSE ? '&' : '?') . $options['query'];
Index: sites/default/default.settings.php
===================================================================
RCS file: /cvs/drupal/drupal/sites/default/default.settings.php,v
retrieving revision 1.8.2.4
diff -u -p -r1.8.2.4 default.settings.php
--- sites/default/default.settings.php	14 Sep 2009 12:59:18 -0000	1.8.2.4
+++ sites/default/default.settings.php	10 Nov 2009 21:40:21 -0000
@@ -237,3 +237,26 @@ ini_set('url_rewriter.tags',        '');
 #   'forum'      => 'Discussion board',
 #   '@count min' => '@count minutes',
 # );
+
+/**
+ * Non-critical API Changes:
+ *
+ * After Drupal 6.0 was released, code development started on the next major
+ * version (7.0). Minor version upgrades (6.1, 6.2, etc.) include bug fixes that
+ * are unlikely to cause unexpected problems with 6.x-* versions of contributed
+ * modules and themes. API changes (code changes that might cause unexpected
+ * problems with 6.x-* versions of contributed modules and themes) are only
+ * included in minor version upgrades of Drupal if necessary to fix a security
+ * issue or other critical bug. In some cases, a non-critical bug fix that
+ * requires an API change is strongly desired by a substantial number of Drupal
+ * users and developers. In these cases, the option for the API change is
+ * included in the next minor release, but disabled by default. These changes
+ * are listed below. To enable a particular change, remove the leading hash
+ * sign.
+ *
+ * If unsure, leave disabled. Only enable if you are using a module or theme
+ * that instructs you to do so. Enabling an API change may cause unexpected
+ * problems with some modules or themes, so ask a developer to evaluate whether
+ * it's safe to enable a particular change for your site.
+ */
+# $conf['drupal_non_critical_api_changes']['custom_url_rewrite_outbound']['include_external'] = TRUE;  // http://drupal.org/node/535612
