* (bug 1853) On 'go' match, try without quotes if given quoted term
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 10 Apr 2005 00:03:49 +0000 (00:03 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 10 Apr 2005 00:03:49 +0000 (00:03 +0000)
includes/SearchEngine.php

index a49f8e5..e1de0bb 100644 (file)
@@ -42,6 +42,7 @@ class SearchEngine {
         * If an exact title match can be find, or a very slightly close match,
         * return the title. If no match, returns NULL.
         *
+        * @static
         * @param string $term
         * @return Title
         * @access private
@@ -88,6 +89,11 @@ class SearchEngine {
                        return $title;
                }
                
+               # Quoted term? Try without the quotes...
+               if( preg_match( '/^"([^"]+)"$/', $term, $matches ) ) {
+                       return SearchEngine::getNearMatch( $matches[1] );
+               }
+               
                return NULL;
        }