diff options
Diffstat (limited to 'program')
-rw-r--r-- | program/include/rcube_mdb2.php | 8 | ||||
-rw-r--r-- | program/include/rcube_shared.inc | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/program/include/rcube_mdb2.php b/program/include/rcube_mdb2.php index 0769b635e..a2baf33c0 100644 --- a/program/include/rcube_mdb2.php +++ b/program/include/rcube_mdb2.php @@ -123,16 +123,16 @@ class rcube_mdb2 { // Already connected if ($this->db_connected) { + // connected to read-write db, current connection is ok + if ($this->db_mode == 'w') + return; + // no replication, current connection is ok for read and write if (empty($this->db_dsnr) || $this->db_dsnw == $this->db_dsnr) { $this->db_mode = 'w'; return; } - // connected to read-write db, current connection is ok - if ($this->db_mode == 'w') - return; - // Same mode, current connection is ok if ($this->db_mode == $mode) return; diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc index 429969eb7..575a28ae0 100644 --- a/program/include/rcube_shared.inc +++ b/program/include/rcube_shared.inc @@ -227,7 +227,7 @@ function make_absolute_url($path, $base_url) // cut base_url to the last directory if (strrpos($base_url, '/')>7) { - $host_url = substr($base_url, 0, strpos($base_url, '/')); + $host_url = substr($base_url, 0, strpos($base_url, '/', 7)); $base_url = substr($base_url, 0, strrpos($base_url, '/')); } |