diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 59175be68843b..5d2f4236a848f 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -291,7 +291,7 @@ private function isUsedTlsLibOutdated() { } // Check if NSS and perform heuristic check - if (strpos($versionString, 'NSS/') === 0) { + if (str_starts_with($versionString, 'NSS/')) { try { $firstClient = $this->clientService->newClient(); $firstClient->get('https://nextcloud.com/'); @@ -382,7 +382,7 @@ private function isCorrectMemcachedPHPModuleInstalled() { */ private function isSettimelimitAvailable() { if (function_exists('set_time_limit') - && strpos(ini_get('disable_functions'), 'set_time_limit') === false) { + && !str_contains(ini_get('disable_functions'), 'set_time_limit')) { return true; } @@ -566,7 +566,7 @@ protected function hasMissingColumns(): array { } protected function isSqliteUsed() { - return strpos($this->config->getSystemValue('dbtype'), 'sqlite') !== false; + return str_contains($this->config->getSystemValue('dbtype'), 'sqlite'); } protected function isReadOnlyConfig(): bool { diff --git a/apps/settings/lib/Search/AppSearch.php b/apps/settings/lib/Search/AppSearch.php index fa3d884e80d83..d4735f1c744f7 100644 --- a/apps/settings/lib/Search/AppSearch.php +++ b/apps/settings/lib/Search/AppSearch.php @@ -83,7 +83,7 @@ public function search(IUser $user, ISearchQuery $query): SearchResult { continue; } - if (strpos($query->getRoute(), $entry['id'] . '.') === 0) { + if (str_starts_with($query->getRoute(), $entry['id'] . '.')) { // Skip the current app, unlikely this is intended continue; } diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php index 535c160652763..9fbee6ef62fa5 100644 --- a/apps/settings/lib/Settings/Personal/PersonalInfo.php +++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php @@ -333,8 +333,8 @@ private function getLocaleMap(IUser $user): array { $userLocale = reset($userLocale); } - $localesForLanguage = array_values(array_filter($localeCodes, fn ($localeCode) => strpos($localeCode['code'], $userLang) === 0)); - $otherLocales = array_values(array_filter($localeCodes, fn ($localeCode) => strpos($localeCode['code'], $userLang) !== 0)); + $localesForLanguage = array_values(array_filter($localeCodes, fn ($localeCode) => str_starts_with($localeCode['code'], $userLang))); + $otherLocales = array_values(array_filter($localeCodes, fn ($localeCode) => !str_starts_with($localeCode['code'], $userLang))); if (!$userLocale) { $userLocale = [ diff --git a/apps/settings/lib/SetupChecks/SupportedDatabase.php b/apps/settings/lib/SetupChecks/SupportedDatabase.php index 302797485d326..c925ad48043cf 100644 --- a/apps/settings/lib/SetupChecks/SupportedDatabase.php +++ b/apps/settings/lib/SetupChecks/SupportedDatabase.php @@ -68,7 +68,7 @@ public function check() { $row = $result->fetch(); $version = strtolower($row['Value']); - if (strpos($version, 'mariadb') !== false) { + if (str_contains($version, 'mariadb')) { if (version_compare($version, '10.2', '<')) { $this->description = $this->l10n->t('MariaDB version "%s" is used. Nextcloud 21 and higher do not support this version and require MariaDB 10.2 or higher.', $row['Value']); return;