Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.389
diff -u -r1.389 common.inc
--- includes/common.inc 15 Sep 2004 09:54:32 -0000 1.389
+++ includes/common.inc 16 Sep 2004 14:42:00 -0000
@@ -1555,50 +1555,31 @@
     $script = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') === false) ? 'index.php' : '';
   }
 
-  $path = drupal_get_path_alias($path);
+  $fragment = ($fragment ? "#$fragment" : '');
 
-  if (isset($fragment)) {
-    $fragment = '#'. $fragment;
+  if (preg_match('<^[a-z]+://>', $path)) {
+    $base = $path;
+    $path = '';
+    $query = ($query ? "?$query" : '');
   }
+  else {
+    $base = ($absolute ? "$base_url/" : '');
+    $path = drupal_get_path_alias($path);
 
-  $base = ($absolute ? $base_url . '/' : '');
-
-  if (variable_get('clean_url', '0') == '0') {
-    if (isset($path)) {
-      if (isset($query)) {
-        return $base . $script .'?q='. $path .'&amp;'. $query . $fragment;
-      }
-      else {
-        return $base . $script .'?q='. $path . $fragment;
-      }
-    }
-    else {
-      if (isset($query)) {
-        return $base . $script .'?'. $query . $fragment;
-      }
-      else {
-        return $base . $fragment;
-      }
+    if (variable_get('clean_url', 0)) {
+      $query = ($query ? "?$query" : '');
     }
-  }
-  else {
-    if (isset($path)) {
-      if (isset($query)) {
-        return $base . $path .'?'. $query . $fragment;
-      }
-      else {
-        return $base . $path . $fragment;
-      }
+    elseif ($path) {
+      $query = ($query ? "$script?q=$path&amp;$query" : "$script?q=$path");
+      $path = '';
     }
     else {
-      if (isset($query)) {
-        return $base . $script .'?'. $query . $fragment;
-      }
-      else {
-        return $base . $fragment;
-      }
+      $query = ($query ? "$script?$query" : $script);
+      $path = '';
     }
   }
+
+  return "$base$path$query$fragment";
 }
 
 /**
