Index: branches/2.6/admin/history.php
===================================================================
--- branches/2.6/admin/history.php	(revision 26960)
+++ branches/2.6/admin/history.php	(revision 26999)
@@ -340,4 +340,6 @@
     name, url_name
   FROM '.TAGS_TABLE;
+
+    global $name_of_tag; // used for preg_replace
     $name_of_tag = array();
     $result = pwg_query($query);
@@ -400,7 +402,7 @@
     if (isset($line['tag_ids']))
     {
-      $tags_string = preg_replace(
-        '/(\d+)/e',
-        'isset($name_of_tag["$1"]) ? $name_of_tag["$1"] : "$1"',
+      $tags_string = preg_replace_callback(
+        '/(\d+)/',
+        create_function('$m', 'return isset($name_of_tag[$m[1]]) ? $name_of_tag[$m[1]] : $m[1];'),
         str_replace(
           ',',
@@ -542,4 +544,6 @@
       )
     );
+
+  unset($name_of_tag);
 }
 
Index: branches/2.6/admin/include/functions.php
===================================================================
--- branches/2.6/admin/include/functions.php	(revision 26960)
+++ branches/2.6/admin/include/functions.php	(revision 26999)
@@ -577,4 +577,5 @@
   ORDER BY id_uppercat,rank,name';
 
+  global $cat_map; // used in preg_replace callback
   $cat_map = array();
 
@@ -603,11 +604,14 @@
   $datas = array();
 
+  $cat_map_callback = create_function('$m', 'global $cat_map; return $cat_map[$m[1]]["rank"];');
+
   foreach( $cat_map as $id=>$cat )
   {
-    $new_global_rank = preg_replace(
-          '/(\d+)/e',
-          "\$cat_map['$1']['rank']",
-          str_replace(',', '.', $cat['uppercats'] )
-          );
+    $new_global_rank = preg_replace_callback(
+      '/(\d+)/',
+      $cat_map_callback,
+      str_replace(',', '.', $cat['uppercats'] )
+      );
+
     if ( $cat['rank_changed']
       or $new_global_rank!=$cat['global_rank']
@@ -621,4 +625,6 @@
     }
   }
+
+  unset($cat_map);
 
   mass_updates(
Index: branches/2.6/admin/include/languages.class.php
===================================================================
--- branches/2.6/admin/include/languages.class.php	(revision 26960)
+++ branches/2.6/admin/include/languages.class.php	(revision 26999)
@@ -403,14 +403,4 @@
    * Sort functions
    */
-  function language_version_compare($a, $b)
-  {
-    $pattern = array('/([a-z])/ei', '/\.+/', '/\.\Z|\A\./');
-    $replacement = array( "'.'.intval('\\1', 36).'.'", '.', '');
-
-    $array = preg_replace($pattern, $replacement, array($a, $b));
-
-    return version_compare($array[0], $array[1], '>=');
-  }
-
   function extension_name_compare($a, $b)
   {
Index: branches/2.6/admin/include/plugins.class.php
===================================================================
--- branches/2.6/admin/include/plugins.class.php	(revision 26960)
+++ branches/2.6/admin/include/plugins.class.php	(revision 26999)
@@ -615,23 +615,4 @@
    * Sort functions
    */
-  function plugin_version_compare($a, $b)
-  {
-    if (strtolower($a) == 'auto') return false;
-    
-    $array = preg_replace(
-      array('/\.+/', '/\.\Z|\A\./'),
-      array('.', ''),
-      array($a, $b)
-      );
-      
-    $array = preg_replace_callback(
-      '/([a-z])/i',
-      create_function('$m', 'return intval($m[1], 36);'),
-      $array
-      );
-    
-    return version_compare($array[0], $array[1], '>=');
-  }
-
   function extension_revision_compare($a, $b)
   {
Index: branches/2.6/admin/include/themes.class.php
===================================================================
--- branches/2.6/admin/include/themes.class.php	(revision 26960)
+++ branches/2.6/admin/include/themes.class.php	(revision 26999)
@@ -690,14 +690,4 @@
    * Sort functions
    */
-  function theme_version_compare($a, $b)
-  {
-    $pattern = array('/([a-z])/ei', '/\.+/', '/\.\Z|\A\./');
-    $replacement = array( "'.'.intval('\\1', 36).'.'", '.', '');
-
-    $array = preg_replace($pattern, $replacement, array($a, $b));
-
-    return version_compare($array[0], $array[1], '>=');
-  }
-
   function extension_revision_compare($a, $b)
   {
Index: branches/2.6/include/emogrifier.class.php
===================================================================
--- branches/2.6/include/emogrifier.class.php	(revision 26960)
+++ branches/2.6/include/emogrifier.class.php	(revision 26999)
@@ -36,4 +36,5 @@
     2012-05-01  Made removal of invisible nodes operate in a case-insensitive manner... Thanks Juha P.!
     2013-10-10  Add preserveStyleTag option
+    2014-01-26  PHP 5.5 compatibility (/e modifier is deprecated in preg_replace)
 */
 
@@ -125,5 +126,5 @@
         $nodes = @$xpath->query('//*[@style]');
         foreach ($nodes as $node) {
-            $normalizedOrigStyle = preg_replace('/[A-z\-]+(?=\:)/Se',"strtolower('\\0')", $node->getAttribute('style'));
+            $normalizedOrigStyle = preg_replace_callback('/[A-z\-]+(?=\:)/S',create_function('$m', 'return strtolower($m[0]);'),$node->getAttribute('style'));
 
             // in order to not overwrite existing style attributes in the HTML, we have to save the original HTML styles
@@ -300,7 +301,4 @@
                                '/(\w)\[(\w+)\]/', // Matches element with attribute
                                '/(\w)\[(\w+)\=[\'"]?(\w+)[\'"]?\]/', // Matches element with EXACT attribute
-                               '/(\w+)?\#([\w\-]+)/e', // Matches id attributes
-                               '/(\w+|[\*\]])?((\.[\w\-]+)+)/e', // Matches class attributes
-
             );
             $replace = array(
@@ -312,9 +310,11 @@
                                '\\1[@\\2]',
                                '\\1[@\\2="\\3"]',
-                               "(strlen('\\1') ? '\\1' : '*').'[@id=\"\\2\"]'",
-                               "(strlen('\\1') ? '\\1' : '*').'[contains(concat(\" \",@class,\" \"),concat(\" \",\"'.implode('\",\" \"))][contains(concat(\" \",@class,\" \"),concat(\" \",\"',explode('.',substr('\\2',1))).'\",\" \"))]'",
             );
 
             $css_selector = '//'.preg_replace($search, $replace, $css_selector);
+
+            // matches ids and classes
+            $css_selector = preg_replace_callback('/(\w+)?\#([\w\-]+)/', array($this, 'matchIdAttributes'), $css_selector);
+            $css_selector = preg_replace_callback('/(\w+|[\*\]])?((\.[\w\-]+)+)/', array($this, 'matchClassAttributes'), $css_selector);
 
             // advanced selectors are going to require a bit more advanced emogrification
@@ -326,4 +326,12 @@
         }
         return $this->caches[CACHE_SELECTOR][$xpathkey];
+    }
+
+    private function matchIdAttributes($m) {
+      return (strlen($m[1]) ? $m[1] : '*').'[@id="'.$m[2].'"]';
+    }
+
+    private function matchClassAttributes($m) {
+      return (strlen($m[1]) ? $m[1] : '*').'[contains(concat(" ",@class," "),concat(" ","'.implode('"," "))][contains(concat(" ",@class," "),concat(" ","',explode('.',substr($m[2],1))).'"," "))]';
     }
 
