Special:Listfiles doesn't find anything if the search term contains german umlauts (the letters äöüÄÖÜß) - for example, searching for "Möhre" will give zero results, but I have files like "Möhre-Wilde-Blüte.jpg" and "Pfalz-Möhren-1.jpg".
The problem seems to be somewhere in $dbr->buildLike which replaces the "ö" with "\xc3\xb6". This "\xc3\xb6" doesn't match anything in the database.
At the moment, I'm using the patch pasted below as workaround - but it can give too many results (searching for "möhr" will also find "mähr" or even "mxyr").
Additionally, my patch replaces everything except the listed chars, so you might get even more results if a user searches for a special character.
(I can live with that for now - better than finding nothing ;-)
I'm also not sure where this should be fixed - I added my workaround to SpecialListfiles.php to avoid unintentional side effects, but it would probably be better to fix the code in $dbr->buildLike.
Patch with workaround (see limitations/known issues above)
=================================================================== --- SpecialListfiles.php (Revision 86040) +++ SpecialListfiles.php (Arbeitskopie) @@ -34,11 +34,13 @@ class ImageListPager / __construct() } $search = $wgRequest->getText( 'ilsearch' ); if ( $search != '' && !$wgMiserMode ) { +$search = preg_replace('/[^a-zA-Z0-9_ .-]/', '@@uml@@', $search); $nt = Title::newFromURL( $search ); if( $nt ) { $dbr = wfGetDB( DB_SLAVE ); - $this->mQueryConds = array( 'LOWER(img_name)' . $dbr->buildLike( $dbr->anyString(), - strtolower( $nt->getDBkey() ), $dbr->anyString() ) ); +$cond = $dbr->buildLike( $dbr->anyString(), strtolower( $nt->getDBkey() ), $dbr->anyString() ); +$cond = str_replace('@@uml@@', '_', $cond); + $this->mQueryConds = array( 'LOWER(img_name)' . $cond ); } }
Version: 1.16.x
Severity: normal