* With $wgCapitalLinks off, accept off-by-first-letter-case in 'go' match
[lhc/web/wiklou.git] / includes / SearchEngine.php
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 );