Use native str_contains/str_starts_with in a few more places

This makes the code quit a bit more readable, I believe.

Change-Id: I4aef30d5e20d095c421a13ad5104d64c71361c88
This commit is contained in:
thiemowmde
2024-04-04 08:56:26 +02:00
parent 814a62926a
commit 7d5cb91cfe
2 changed files with 2 additions and 2 deletions

View File

@@ -56,7 +56,7 @@ class LanguageNameSearch {
if ( $languageNameUtils->isKnownLanguageTag( $searchKey ) ) {
$name = mb_strtolower( $languageNameUtils->getLanguageName( $searchKey, $userLanguage ) );
// Check if language code is a prefix of the name
if ( strpos( $name, $searchKey ) === 0 ) {
if ( str_starts_with( $name, $searchKey ) ) {
$results[$searchKey] = $name;
} else {
$results[$searchKey] = "$searchKey $name";