From 902b4483b0b40da51a1116905a8fdb46c0c4eb02 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Mon, 13 Sep 2010 15:41:54 +0200 Subject: [PATCH] Fix checking of return value from ldap_exists() (Bug #9235). --- framework/Group/lib/Horde/Group/Ldap.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/Group/lib/Horde/Group/Ldap.php b/framework/Group/lib/Horde/Group/Ldap.php index 357bd9240..c5bd02e8f 100644 --- a/framework/Group/lib/Horde/Group/Ldap.php +++ b/framework/Group/lib/Horde/Group/Ldap.php @@ -451,11 +451,11 @@ class Horde_Group_Ldap extends Horde_Group $group = $this->getGroupShortName($group); $res = @ldap_compare($this->_ds, $groupDN, $this->_params['gid'], $group); - if ($res === false) { + // $res is True if the group exists, false if not, -1 on error. + if ($res === -1) { throw new Horde_Group_Exception(sprintf('Internal Error: An attribute must ALWAYS match itself: %s', @ldap_error($this->_ds))); } - // $res is True if the group exists, -1 if not, false never - $cache[$group] = ($res === true); + $cache[$group] = $res } return $cache[$group]; -- 2.11.0