--- common.inc	2007-06-30 23:06:03.468750000 -0700
+++ common.inc	2007-07-10 05:59:52.062500000 -0700
@@ -240,7 +240,12 @@ function drupal_query_string_encode($que
  */
 function drupal_get_destination() {
   if (isset($_REQUEST['destination'])) {
-    return 'destination='. urlencode($_REQUEST['destination']);
+    $path = isset($_GET['q']) ? $_GET['q'] : '';
+    $query = drupal_query_string_encode($_GET, array('q'));
+    if ($query != '') {
+      $path .= '?'. $query;
+    }
+    return 'destination='. urlencode($_REQUEST['destination'].$path);
   }
   else {
     // Use $_GET here to retrieve the original path in source form.
