? path_redirect-218277-9-prevent_endless_redirects.patch
? prevent_endless_redirects_218277.patch
Index: path_redirect.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/path_redirect/path_redirect.module,v
retrieving revision 1.3.2.28
diff -u -p -r1.3.2.28 path_redirect.module
--- path_redirect.module	5 Mar 2008 03:27:06 -0000	1.3.2.28
+++ path_redirect.module	6 Mar 2008 14:34:57 -0000
@@ -39,8 +39,11 @@ function path_redirect_init() {
     $r = db_fetch_object(db_query("SELECT redirect, query, fragment, type FROM {path_redirect} WHERE path = '%s' OR path = '%s'", $path, utf8_encode($path)));
   }
 
+  if (url($r->redirect) == url($path)) {
+    watchdog('Path Redirect', t('You have an endless redirect for %redirect which you should consider deleting.', array('%redirect' => $r->redirect)));
+  }
   // only redirect if allow_bypass is off or bypass is not requested
-  if ($r && !(variable_get('path_redirect_allow_bypass', 0) && !empty($_GET['redirect']) && $_GET['redirect'] == 'no')) {
+  else if ($r && !(variable_get('path_redirect_allow_bypass', 0) && !empty($_GET['redirect']) && $_GET['redirect'] == 'no')) {
     if (variable_get('path_redirect_redirect_warning', 0)) {
       drupal_set_message(t('This page has been moved. You may want to update your bookmarks.'));
     }
