diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php index fa10312a915..8568425015b 100644 --- a/apps/user_ldap/lib/Mapping/AbstractMapping.php +++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php @@ -113,7 +113,7 @@ abstract class AbstractMapping { * @return string|false */ public function getDNByName($name) { - $dn = array_search($name, $this->cache); + $dn = array_search($name, $this->cache, true); if ($dn === false && ($dn = $this->getXbyY('ldap_dn', 'owncloud_name', $name)) !== false) { $this->cache[$dn] = $name; } @@ -370,7 +370,7 @@ abstract class AbstractMapping { DELETE FROM `' . $this->getTableName() . '` WHERE `owncloud_name` = ?'); - $dn = array_search($name, $this->cache); + $dn = array_search($name, $this->cache, true); if ($dn !== false) { unset($this->cache[$dn]); } diff --git a/apps/user_ldap/tests/User/DeletedUsersIndexTest.php b/apps/user_ldap/tests/User/DeletedUsersIndexTest.php index 0e77f5023d5..a4324edd322 100644 --- a/apps/user_ldap/tests/User/DeletedUsersIndexTest.php +++ b/apps/user_ldap/tests/User/DeletedUsersIndexTest.php @@ -75,7 +75,7 @@ class DeletedUsersIndexTest extends \Test\TestCase { // ensure the different uids were used foreach ($deletedUsers as $deletedUser) { $this->assertTrue(in_array($deletedUser->getOCName(), $uids)); - $i = array_search($deletedUser->getOCName(), $uids); + $i = array_search($deletedUser->getOCName(), $uids, true); $this->assertNotFalse($i); unset($uids[$i]); }