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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user