mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 01:00:50 -04:00
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:
parent
9e9212b1b8
commit
7e26a2975d
2 changed files with 3 additions and 3 deletions
|
|
@ -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]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue