Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/Sabre/TagsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private function getTagsAndFav($fileId) {
$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]);
Expand Down
4 changes: 2 additions & 2 deletions apps/settings/lib/Settings/Personal/PersonalInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ private function getLanguageMap(IUser $user): array {
$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
Expand Down
2 changes: 1 addition & 1 deletion apps/user_ldap/lib/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private function getServersConfig(string $value): array {
*/
public function deleteServerConfiguration($prefix) {
$prefixes = $this->getServerConfigurationPrefixes();
$index = array_search($prefix, $prefixes);
$index = array_search($prefix, $prefixes, true);
if ($index === false) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/user_ldap/lib/Mapping/AbstractMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public function unmap($name) {
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]);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/user_ldap/tests/User/DeletedUsersIndexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function testMarkAndFetchUser(): void {
// 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]);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/user_status/lib/Listener/UserLiveStatusListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function handle(Event $event): void {

// 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;
}

Expand Down
2 changes: 1 addition & 1 deletion build/integration/features/bootstrap/Trashbin.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function checkTrashContents($user, $folder, $expectedElements) {
$elementsSimplified = $this->simplifyArray($elementRows);
foreach ($elementsSimplified as $expectedElement) {
$expectedElement = ltrim($expectedElement, '/');
if (array_search($expectedElement, $trashContent) === false) {
if (array_search($expectedElement, $trashContent, true) === false) {
Assert::fail("$expectedElement" . ' is not in trash listing');
}
}
Expand Down
2 changes: 1 addition & 1 deletion build/integration/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ public function theResponseShouldContainAShareTypesPropertyWith($table) {
}

foreach ($table->getRows() as $row) {
$key = array_search($row[0], $foundTypes);
$key = array_search($row[0], $foundTypes, true);
if ($key === false) {
throw new \Exception('Expected type ' . $row[0] . ' not found');
}
Expand Down
2 changes: 1 addition & 1 deletion lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ private static function registerAppRestrictionsHooks(): void {
if (empty($restrictions)) {
continue;
}
$key = array_search($group->getGID(), $restrictions);
$key = array_search($group->getGID(), $restrictions, true);
unset($restrictions[$key]);
$restrictions = array_values($restrictions);
if (empty($restrictions)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Accounts/AccountManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ protected function sendEmailVerificationEmail(IUser $user, string $email): bool
protected function addMissingDefaultValues(array $userData, array $defaultUserData): array {
foreach ($defaultUserData as $defaultDataItem) {
// If property does not exist, initialize it
$userDataIndex = array_search($defaultDataItem['name'], array_column($userData, 'name'));
$userDataIndex = array_search($defaultDataItem['name'], array_column($userData, 'name'), true);
if ($userDataIndex === false) {
$userData[] = $defaultDataItem;
continue;
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Storage/Local.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public function file_exists(string $path): bool {
return false;
}
$content = scandir($parentPath, SCANDIR_SORT_NONE);
return is_array($content) && array_search(basename($fullPath), $content) !== false;
return is_array($content) && array_search(basename($fullPath), $content, true) !== false;
} else {
return file_exists($this->getSourcePath($path));
}
Expand Down
2 changes: 1 addition & 1 deletion lib/private/L10N/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ public function getLanguages(): array {
// put appropriate languages into appropriate arrays, to print them sorted
// common languages -> divider -> other languages
if (in_array($lang, self::COMMON_LANGUAGE_CODES)) {
$commonLanguages[array_search($lang, self::COMMON_LANGUAGE_CODES)] = $ln;
$commonLanguages[array_search($lang, self::COMMON_LANGUAGE_CODES, true)] = $ln;
} else {
$otherLanguages[] = $ln;
}
Expand Down
3 changes: 2 additions & 1 deletion lib/private/Tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,8 @@ protected function array_searchi($needle, $haystack, $mem = 'getName') {
return array_search(strtolower($needle), array_map(
function ($tag) use ($mem) {
return strtolower(call_user_func([$tag, $mem]));
}, $haystack)
}, $haystack),
true
);
}

Expand Down
Loading