From 9d6d76a26dc4125b2005f89fa9a2bc46882b6514 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 23 Jun 2015 12:41:50 +0200 Subject: [PATCH] Ldap\Connection: Return false if nothing is found for fetchOne() This should behave like DbConnection::fetchOne(). refs #8954 --- library/Icinga/Protocol/Ldap/Connection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/Protocol/Ldap/Connection.php b/library/Icinga/Protocol/Ldap/Connection.php index f5ca017f3..dce492817 100644 --- a/library/Icinga/Protocol/Ldap/Connection.php +++ b/library/Icinga/Protocol/Ldap/Connection.php @@ -143,7 +143,7 @@ class Connection implements Selectable public function fetchOne($query, $fields = array()) { $row = (array) $this->fetchRow($query, $fields); - return array_shift($row); + return array_shift($row) ?: false; } public function hasDN($dn)