LanguageNameIndexer/Search: use unicode aware lowercasing

With this MEÄNKELI with typos=1 finds results.

Updated test case for lowercased result. Renamed variables in test
file for clarity. Updated the default value for MW_INSTALL_PATH to
work with the default layout.

Change-Id: Id93c84d308705f55b4d2378fc8c7b7f243e1b53f
This commit is contained in:
Niklas Laxström
2016-06-15 10:13:49 +02:00
parent 920155fb18
commit 9daeacf1c5
5 changed files with 11 additions and 8 deletions

View File

@@ -29,8 +29,11 @@ class LanguageNameSearch {
self::init();
}
// Use code's mb_strtolower compatibily code for MW < 1.27
$language = Language::factory( 'en' );
// @todo: Shouldn't this be unicode aware?
$searchKey = strtolower( $searchKey );
$searchKey = $language->lc( $searchKey );
$index = self::getIndex( $searchKey );
if ( !isset( self::$languagenames[$index] ) ) {