* With $wgCapitalLinks off, accept off-by-first-letter-case in 'go' match
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 13 Jul 2005 06:47:17 +0000 (06:47 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 13 Jul 2005 06:47:17 +0000 (06:47 +0000)
Requested by Wiktionary folks dealing with conversion issues.

RELEASE-NOTES
includes/SearchEngine.php

index 9ff7f21..87f70cd 100644 (file)
@@ -565,8 +565,7 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new.
 * Nynorsk numeric format fix
 * (bug 2825) Fix regression in newtalk notifications for anons w/ enotif off
 * (bug 2833) Fix bug in previous fix
-* Accept --server option for database to read main query from on backup
-* live fix: force index on Special:Export only for backup dump
+* With $wgCapitalLinks off, accept off-by-first-letter-case in 'go' match
 
 
 === Caveats ===
index 7642351..45642ee 100644 (file)
@@ -80,6 +80,19 @@ class SearchEngine {
                if ( $title->exists() ) {
                        return $title;
                }
+               
+               global $wgCapitalLinks, $wgContLang;
+               if( !$wgCapitalLinks ) {
+                       // Catch differs-by-first-letter-case-only
+                       $title = Title::newFromText( $wgContLang->ucfirst( $term ) );
+                       if ( $title->exists() ) {
+                               return $title;
+                       }
+                       $title = Title::newFromText( $wgContLang->lcfirst( $term ) );
+                       if ( $title->exists() ) {
+                               return $title;
+                       }
+               }
 
                $title = Title::newFromText( $term );