diff --git includes/common.inc includes/common.inc
index 3d73784..5f085b2 100644
--- includes/common.inc
+++ includes/common.inc
@@ -323,7 +323,8 @@ function drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response
     $colonpos = strpos($destination, ':');
     $absolute = ($colonpos !== FALSE && !preg_match('![/?#]!', substr($destination, 0, $colonpos)));
     if (!$absolute) {
-      extract(parse_url(urldecode($destination)));
+      preg_match('/^([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/', urldecode($_REQUEST['destination']), $matches);
+      list(, $path, $query, $fragment) = $matches;
     }
   }
 
