* (bug 278) Search results no longer highlight incorrect partial word matches
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 1 Oct 2007 13:05:26 +0000 (13:05 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 1 Oct 2007 13:05:26 +0000 (13:05 +0000)
RELEASE-NOTES
includes/SearchMySQL4.php

index cc7f6d6..98bae4f 100644 (file)
@@ -79,6 +79,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 11462) Fix typo in LanguageGetSpecialPageAliases hook name
 * (bug 11474) Fix unintentional fall-through in math error handling
 * (bug 11478) Fix undefined method call in file deletion interface
+* (bug 278) Search results no longer highlight incorrect partial word matches
+
 
 === API changes in 1.12 ===
 
index 2cd3a54..271dbe1 100644 (file)
@@ -54,7 +54,7 @@ class SearchMySQL4 extends SearchMySQL {
                                        // Match the quoted term in result highlighting...
                                        $regexp = preg_quote( str_replace( '"', '', $terms[2] ), '/' );
                                }
-                               $this->searchTerms[] = $regexp;
+                               $this->searchTerms[] = "\b$regexp\b";
                        }
                        wfDebug( "Would search with '$searchon'\n" );
                        wfDebug( 'Match with /\b' . implode( '\b|\b', $this->searchTerms ) . "\b/\n" );