Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.535
diff -u -r1.535 common.inc
--- includes/common.inc	13 Apr 2006 08:25:27 -0000	1.535
+++ includes/common.inc	13 Apr 2006 09:31:26 -0000
@@ -162,8 +162,6 @@
  *   The array to be processed e.g. $_GET
  * @param $exclude
  *   The array filled with keys to be excluded. Use parent[child] to exclude nested items.
- * @param $urlencode
- *   If TRUE, the keys and values are both urlencoded.
  * @param $parent
  *   Should not be passed, only used in recursive calls
  * @return
@@ -173,11 +171,10 @@
   $params = array();
 
   foreach ($query as $key => $value) {
+    $key = urlencode($key);
+
     if ($parent) {
-      $key = $parent .'['. urlencode($key) .']';
-    }
-    else {
-      $key = urlencode($key);
+      $key = $parent .'['. $key .']';
     }
 
     if (in_array(urldecode($key), $exclude)) {
Index: includes/tablesort.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/tablesort.inc,v
retrieving revision 1.38
diff -u -r1.38 tablesort.inc
--- includes/tablesort.inc	13 Apr 2006 08:25:27 -0000	1.38
+++ includes/tablesort.inc	13 Apr 2006 09:35:15 -0000
@@ -16,6 +16,9 @@
   $ts = tablesort_get_order($header);
   $ts['sort'] = tablesort_get_sort($header);
   $ts['query_string'] = tablesort_get_querystring();
+  if ($ts['query_string'] != '') {
+    $ts['query_string'] = '&'. $ts['query_string'];
+  }
   return $ts;
 }
 
@@ -74,7 +77,7 @@
       $ts['sort'] = 'asc';
       $image = '';
     }
-    $cell['data'] = l($cell['data'] . $image, $_GET['q'], array('title' => $title), 'sort='. $ts['sort'] .'&order='. urlencode($cell['data']) .'&'. $ts['query_string'], NULL, FALSE, TRUE);
+    $cell['data'] = l($cell['data'] . $image, $_GET['q'], array('title' => $title), 'sort='. $ts['sort'] .'&order='. urlencode($cell['data']) . $ts['query_string'], NULL, FALSE, TRUE);
 
     unset($cell['field'], $cell['sort']);
   }
