From 666e67b405ff065f03148e48f00d4964b93c22a8 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 10 Nov 2015 13:17:30 +0100 Subject: [PATCH] LdapConnection: Prefer strict checks when utilizing in_array() --- library/Icinga/Protocol/Ldap/LdapConnection.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Protocol/Ldap/LdapConnection.php b/library/Icinga/Protocol/Ldap/LdapConnection.php index fe18c100e..95d21b987 100644 --- a/library/Icinga/Protocol/Ldap/LdapConnection.php +++ b/library/Icinga/Protocol/Ldap/LdapConnection.php @@ -695,7 +695,7 @@ class LdapConnection implements Selectable, Inspectable )); } else { foreach ($query->getOrder() as $rule) { - if (! in_array($rule[0], $fields)) { + if (! in_array($rule[0], $fields, true)) { $fields[] = $rule[0]; } } @@ -812,7 +812,7 @@ class LdapConnection implements Selectable, Inspectable $serverSorting = false;//$this->getCapabilities()->hasOid(LdapCapabilities::LDAP_SERVER_SORT_OID); if (! $serverSorting && $query->hasOrder()) { foreach ($query->getOrder() as $rule) { - if (! in_array($rule[0], $fields)) { + if (! in_array($rule[0], $fields, true)) { $fields[] = $rule[0]; } } @@ -858,7 +858,8 @@ class LdapConnection implements Selectable, Inspectable } elseif (ldap_count_entries($ds, $results) === 0) { if (in_array( ldap_errno($ds), - array(static::LDAP_SIZELIMIT_EXCEEDED, static::LDAP_ADMINLIMIT_EXCEEDED) + array(static::LDAP_SIZELIMIT_EXCEEDED, static::LDAP_ADMINLIMIT_EXCEEDED), + true )) { Logger::warning( 'Unable to request more than %u results. Does the server allow paged search requests? (%s)',