fix: Use strict array search in other shipped apps as well

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2026-01-13 11:48:36 +01:00
parent 3c80b7f2b3
commit dc843f6d0a
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A
3 changed files with 4 additions and 4 deletions

View file

@ -123,7 +123,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin {
$isFav = false;
$tags = $this->getTags($fileId);
if ($tags) {
$favPos = array_search(self::TAG_FAVORITE, $tags);
$favPos = array_search(self::TAG_FAVORITE, $tags, true);
if ($favPos !== false) {
$isFav = true;
unset($tags[$favPos]);

View file

@ -242,11 +242,11 @@ class PersonalInfo implements ISettings {
$languages = $this->l10nFactory->getLanguages();
// associate the user language with the proper array
$userLangIndex = array_search($userConfLang, array_column($languages['commonLanguages'], 'code'));
$userLangIndex = array_search($userConfLang, array_column($languages['commonLanguages'], 'code'), true);
$userLang = $languages['commonLanguages'][$userLangIndex];
// search in the other languages
if ($userLangIndex === false) {
$userLangIndex = array_search($userConfLang, array_column($languages['otherLanguages'], 'code'));
$userLangIndex = array_search($userConfLang, array_column($languages['otherLanguages'], 'code'), true);
$userLang = $languages['otherLanguages'][$userLangIndex];
}
// if user language is not available but set somehow: show the actual code as name

View file

@ -82,7 +82,7 @@ class UserLiveStatusListener implements IEventListener {
// If the emitted status is more important than the current status
// treat it as outdated and update
if (array_search($event->getStatus(), StatusService::PRIORITY_ORDERED_STATUSES) < array_search($userStatus->getStatus(), StatusService::PRIORITY_ORDERED_STATUSES)) {
if (array_search($event->getStatus(), StatusService::PRIORITY_ORDERED_STATUSES, true) < array_search($userStatus->getStatus(), StatusService::PRIORITY_ORDERED_STATUSES, true)) {
$needsUpdate = true;
}