Ldap\Connection: Return false if nothing is found for fetchRow()

This should behave like DbConnection::fetchRow().

refs #8954
This commit is contained in:
Johannes Meyer 2015-06-23 10:49:51 +02:00
parent 15220da645
commit 6d8c56a12f
2 changed files with 2 additions and 2 deletions

View File

@ -325,7 +325,7 @@ class LdapUserBackend extends LdapRepository implements UserBackendInterface
throw new AuthenticationException('Connection not possible.', $e);
}
if ($result === null) {
if ($result === false) {
throw new AuthenticationException(
'No objects with objectClass "%s" in DN "%s" found. (Filter: %s)',
$this->userClass,

View File

@ -235,7 +235,7 @@ class Connection implements Selectable
$query->limit(1);
$query->setUsePagedResults(false);
$results = $this->fetchAll($query, $fields);
return array_shift($results);
return array_shift($results) ?: false;
}
/**