mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
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:
parent
3c80b7f2b3
commit
dc843f6d0a
3 changed files with 4 additions and 4 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue