check if object is returned.
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 20 Mar 2005 10:05:59 +0000 (10:05 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 20 Mar 2005 10:05:59 +0000 (10:05 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9079 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/abook_ldap_server.php

index 3e11517..cfb3600 100644 (file)
@@ -161,7 +161,7 @@ class abook_ldap_server extends addressbook_backend {
 
         $this->linkid = @ldap_connect($this->server, $this->port);
         if(!$this->linkid) {
-            if(function_exists('ldap_error')) {
+            if(function_exists('ldap_error') && is_object($this->linkid)) {
                 return $this->set_error(ldap_error($this->linkid));
             } else {
                 return $this->set_error('ldap_connect failed');