--- path_redirect.module 2008-01-19 13:51:06.000000000 -0600 +++ path_redirect.module 2008-01-19 14:51:29.000000000 -0600 @@ -27,21 +27,24 @@ 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']); - } - $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')) { - // if there's a result found, do the redirect - unset($_REQUEST['destination']); - drupal_goto($r->redirect, ($r->query ? $r->query: NULL), ($r->fragment ? $r->fragment : NULL), $r->type); - } - else { - // page caching is turned on so drupal_goto() (common.inc) hasn't been loaded - path_redirect_goto($r->redirect, ($r->query ? $r->query: NULL), ($r->fragment ? $r->fragment : NULL), $r->type); + // Avoid redirecting other pages like update.php + if ($_SERVER['SCRIPT_NAME'] === '/index.php') { + // see if this page has a redirect path + $query = ''; + if (isset($_SERVER['QUERY_STRING'])) { + $query = preg_replace('/^q=([^&]*).*$/', '\1', $_SERVER['QUERY_STRING']); + } + $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')) { + // if there's a result found, do the redirect + unset($_REQUEST['destination']); + drupal_goto($r->redirect, ($r->query ? $r->query: NULL), ($r->fragment ? $r->fragment : NULL), $r->type); + } + else { + // page caching is turned on so drupal_goto() (common.inc) hasn't been loaded + path_redirect_goto($r->redirect, ($r->query ? $r->query: NULL), ($r->fragment ? $r->fragment : NULL), $r->type); + } } } }