? sites/all/modules/contrib
? sites/default/files
? sites/default/settings.php
Index: includes/database/database.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database/database.inc,v
retrieving revision 1.141
diff -u -p -r1.141 database.inc
--- includes/database/database.inc	15 Oct 2010 18:03:43 -0000	1.141
+++ includes/database/database.inc	8 Nov 2010 06:17:03 -0000
@@ -398,12 +398,26 @@ abstract class DatabaseConnection extend
    *   The properly-prefixed string.
    */
   public function prefixTables($sql) {
+    
+    // Using str_replace() instead of strtr() here, as str_replace() is faster
+    // the longer the string is, the more replacements happen, and when the
+    // needles are delimited.
+    // @see http://php.net/manual/en/function.strtr.php
+
     // Replace specific table prefixes first.
+    $search = $replace = array();
     foreach ($this->prefixes as $key => $val) {
-      $sql = strtr($sql, array('{' . $key . '}' => $val . $key));
+      $search[] = '{' . $key . '}';
+      $replace[] = $val . $key;
     }
+
     // Then replace remaining tables with the default prefix.
-    return strtr($sql, array('{' => $this->defaultPrefix , '}' => ''));
+    $search[] = '{';
+    $replace[] = $this->defaultPrefix;
+    $search[] = '}';
+    $replace[] = '';
+
+    return str_replace($search, $replace, $sql);
   }
 
   /**
