From 0344b168276f80189e2254c75a762aff5b517b6b Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sun, 22 May 2016 06:32:57 -0400
Subject: [PATCH] Fix priority icon(s) position

---
 program/lib/Roundcube/bootstrap.php |   38 ++++++++++++++++++--------------------
 1 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php
index 94e628b..b5745c9 100644
--- a/program/lib/Roundcube/bootstrap.php
+++ b/program/lib/Roundcube/bootstrap.php
@@ -55,7 +55,7 @@
 }
 
 // framework constants
-define('RCUBE_VERSION', '1.2-git');
+define('RCUBE_VERSION', '1.3-git');
 define('RCUBE_CHARSET', 'UTF-8');
 
 if (!defined('RCUBE_LIB_DIR')) {
@@ -428,27 +428,25 @@
  */
 function rcube_autoload($classname)
 {
-    $filename = preg_replace(
-        array(
-            '/Mail_(.+)/',
-            '/Net_(.+)/',
-            '/Auth_(.+)/',
-            '/^html_.+/',
-            '/^rcube(.*)/'
-        ),
-        array(
-            'Mail/\\1',
-            'Net/\\1',
-            'Auth/\\1',
-            'Roundcube/html',
-            'Roundcube/rcube\\1'
-        ),
-        $classname
-    );
+    if (strpos($classname, 'rcube') === 0) {
+        $classname = 'Roundcube/' . $classname;
+    }
+    else if (strpos($classname, 'html_') === 0 || $classname === 'html') {
+        $classname = 'Roundcube/html';
+    }
+    else if (strpos($classname, 'Mail_') === 0) {
+        $classname = 'Mail/' . substr($classname, 5);
+    }
+    else if (strpos($classname, 'Net_') === 0) {
+        $classname = 'Net/' . substr($classname, 4);
+    }
+    else if (strpos($classname, 'Auth_') === 0) {
+        $classname = 'Auth/' . substr($classname, 5);
+    }
 
-    if ($fp = @fopen("$filename.php", 'r', true)) {
+    if ($fp = @fopen("$classname.php", 'r', true)) {
         fclose($fp);
-        include_once "$filename.php";
+        include_once "$classname.php";
         return true;
     }
 

--
Gitblit v1.9.1