Skip to content

Commit 25c0bc1

Browse files
committed
fix: Use strict array search in other shipped apps as well
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent cdce807 commit 25c0bc1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

apps/dav/lib/Connector/Sabre/TagsPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private function getTagsAndFav($fileId) {
123123
$isFav = false;
124124
$tags = $this->getTags($fileId);
125125
if ($tags) {
126-
$favPos = array_search(self::TAG_FAVORITE, $tags);
126+
$favPos = array_search(self::TAG_FAVORITE, $tags, true);
127127
if ($favPos !== false) {
128128
$isFav = true;
129129
unset($tags[$favPos]);

apps/settings/lib/Settings/Personal/PersonalInfo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,11 @@ private function getLanguageMap(IUser $user): array {
242242
$languages = $this->l10nFactory->getLanguages();
243243

244244
// associate the user language with the proper array
245-
$userLangIndex = array_search($userConfLang, array_column($languages['commonLanguages'], 'code'));
245+
$userLangIndex = array_search($userConfLang, array_column($languages['commonLanguages'], 'code'), true);
246246
$userLang = $languages['commonLanguages'][$userLangIndex];
247247
// search in the other languages
248248
if ($userLangIndex === false) {
249-
$userLangIndex = array_search($userConfLang, array_column($languages['otherLanguages'], 'code'));
249+
$userLangIndex = array_search($userConfLang, array_column($languages['otherLanguages'], 'code'), true);
250250
$userLang = $languages['otherLanguages'][$userLangIndex];
251251
}
252252
// if user language is not available but set somehow: show the actual code as name

apps/user_status/lib/Listener/UserLiveStatusListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function handle(Event $event): void {
8282

8383
// If the emitted status is more important than the current status
8484
// treat it as outdated and update
85-
if (array_search($event->getStatus(), StatusService::PRIORITY_ORDERED_STATUSES) < array_search($userStatus->getStatus(), StatusService::PRIORITY_ORDERED_STATUSES)) {
85+
if (array_search($event->getStatus(), StatusService::PRIORITY_ORDERED_STATUSES, true) < array_search($userStatus->getStatus(), StatusService::PRIORITY_ORDERED_STATUSES, true)) {
8686
$needsUpdate = true;
8787
}
8888

0 commit comments

Comments
 (0)