fix: Use strict array comparisons in user_ldap

Otherwise there are issues with string values looking like numbers.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2026-01-13 11:46:57 +01:00
parent 9e9212b1b8
commit 7e26a2975d
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A
2 changed files with 3 additions and 3 deletions

View file

@ -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]);
}

View file

@ -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]);
}