From 9a835c7f7ca3b2e1e021840254a15b0205388dfc Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sat, 27 Aug 2011 04:33:35 -0400
Subject: [PATCH] - Fix is_a() usage for PHP>5.3.6

---
 program/include/rcmail.php |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index c6f8a63..7967f94 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -393,7 +393,10 @@
         $id = '0';
 
     // use existing instance
-    if (isset($this->address_books[$id]) && is_a($this->address_books[$id], 'rcube_addressbook') && (!$writeable || !$this->address_books[$id]->readonly)) {
+    if (isset($this->address_books[$id]) && is_object($this->address_books[$id])
+      && is_a($this->address_books[$id], 'rcube_addressbook')
+      && (!$writeable || !$this->address_books[$id]->readonly)
+    ) {
       $contacts = $this->address_books[$id];
     }
     else if ($id && $ldap_config[$id]) {
@@ -1163,7 +1166,7 @@
       $this->smtp->disconnect();
 
     foreach ($this->address_books as $book) {
-      if (is_a($book, 'rcube_addressbook'))
+      if (is_object($book) && is_a($book, 'rcube_addressbook'))
         $book->close();
     }
 

--
Gitblit v1.9.1