? path_fix_substring_index.patch
Index: path.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/path.inc,v
retrieving revision 1.72
diff -u -p -r1.72 path.inc
--- path.inc	30 Nov 2010 01:05:24 -0000	1.72
+++ path.inc	26 Dec 2010 20:17:21 -0000
@@ -378,9 +378,10 @@ function drupal_path_alias_whitelist_reb
   // path it corresponds to. This is the portion of the path before the first
   // '/', if present, otherwise the whole path itself.
   $whitelist = array();
-  $result = db_query("SELECT DISTINCT SUBSTRING_INDEX(source, '/', 1) AS path FROM {url_alias}");
+  $result = db_query("SELECT DISTINCT source AS path FROM {url_alias}");
   foreach ($result as $row) {
-    $whitelist[$row->path] = TRUE;
+    $pathparts = explode('/',$row->path,1);
+    $whitelist[$pathparts[0]] = TRUE;
   }
   variable_set('path_alias_whitelist', $whitelist);
   return $whitelist;
