--- /home/sseverin/drupal/path_redirect-5.x-1.x/path_redirect.module	2008-01-19 13:51:06.000000000 -0600
+++ path_redirect.module	2008-01-20 16:56:00.000000000 -0600
@@ -28,10 +28,7 @@ function path_redirect_help($section) {
  */
 function path_redirect_init() {
   // see if this page has a redirect path
-  $query = '';
-  if (isset($_SERVER['QUERY_STRING'])) {
-    $query = preg_replace('/^q=([^&]*).*$/', '\1', $_SERVER['QUERY_STRING']);
-  }
+  $query = trim($_SERVER['REQUEST_URI'], '/');
   $r = db_fetch_object(db_query("SELECT redirect, query, fragment, type FROM {path_redirect} WHERE path = '%s' OR path = '%s'", $query, utf8_encode($query)));
   if ($r) {
     if (function_exists('drupal_goto')) {
@@ -151,7 +148,7 @@ function path_redirect_admin($rid = FALS
       $path,
       check_url($redirect . $query . $fragment),
       $types[$r->type]['title'],
-      array('data' => l(t('test'), $r->path, array())),
+      array('data' => l(t('test'), preg_replace('/\?.*/', '', $r->path), array(), preg_replace('/.*\?/', '', $r->path))),
       array('data' => l(t('edit'), 'admin/build/path_redirect/edit/'. $r->rid)),
       array('data' => l(t('delete'), 'admin/build/path_redirect/edit/'. $r->rid .'/delete')),
     );
@@ -270,10 +267,6 @@ function path_redirect_edit_validate($fo
     if (strstr($form_values['path'], '#')) {
       $path_error .= ' '. t('You cannot redirect from a fragment anchor.');
     }
-    // No query string allowed in "from" (but see #174961)
-    if (strstr($form_values['path'], '?')) {
-      $path_error .= ' '. t('You cannot currently include a query in your redirect <strong>from</strong> path.');
-    }
     // Make sure "from" has the form of a local Drupal path
     if (!valid_url($form_values['path'])) {
       $path_error .= ' '. t('The redirect <strong>from</strong> path does not appear valid. This must be a local Drupal path.');
