Index: securesite.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/securesite/securesite.module,v
retrieving revision 1.25
diff -u -r1.25 securesite.module
--- securesite.module	27 Dec 2006 17:16:19 -0000	1.25
+++ securesite.module	29 Dec 2006 19:28:32 -0000
@@ -331,13 +331,7 @@
  */
 function securesite_filter_check() {
 
-  // Ignore page if requested (code used form block filter code.)
-  $pages = variable_get('securesite_filter_pages', '');
-
-  $path       = drupal_get_path_alias($_GET['q']);
-  $regexp     = '/^(' . preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), array('|', '.*', '\1' . preg_quote(variable_get('site_frontpage', 'node'), '/') . '\2'), preg_quote($pages, '/')) . ')$/';
-
-  if (preg_match($regexp, $path)) {
+  if (securesite_check_path()) {
     if (variable_get('securesite_ip_filter_check', false)) {
       if (variable_get('securesite_filter_pages_type', 0) == 0) {
         return securesite_session_ip_check();
@@ -373,6 +367,35 @@
       }
     }
   }
+
+}
+
+/**
+ * check if current path is a securesite path
+ */
+function securesite_check_path() {
+
+  // Ignore page if requested (code used form block filter code.)
+  $pages = variable_get('securesite_filter_pages', '');
+
+  // don't know why but this is required for drupal_get_path_alias to work under curtain conditions
+  drupal_lookup_path('wipe');
+
+  $path       = drupal_get_path_alias($_GET['q']);
+  $regexp     = '/^(' . preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), array('|', '.*', '\1' . preg_quote(variable_get('site_frontpage', 'node'), '/') . '\2'), preg_quote($pages, '/')) . ')$/';
+
+  if (preg_match($regexp, $path)) {
+    return true;
+  }
+  else {
+    $path = drupal_get_normal_path($_GET['q']);
+    if (preg_match($regexp, $path)) {
+      return true;
+    }
+    else {
+      return false;
+    }
+  }
 }
 
 /**
