Index: trunk/phase3/includes/SearchEngine.php |
— | — | @@ -470,7 +470,7 @@ |
471 | 471 | } |
472 | 472 | |
473 | 473 | /** |
474 | | - * @return string highlighted suggested query, '' if none |
| 474 | + * @return string HTML highlighted suggested query, '' if none |
475 | 475 | */ |
476 | 476 | function getSuggestionSnippet(){ |
477 | 477 | return ''; |
Index: trunk/phase3/includes/specials/SpecialSearch.php |
— | — | @@ -169,7 +169,7 @@ |
170 | 170 | $this->powerSearchOptions() |
171 | 171 | ); |
172 | 172 | $suggestLink = $sk->makeKnownLinkObj( $st, |
173 | | - htmlspecialchars( $textMatches->getSuggestionSnippet() ), |
| 173 | + $textMatches->getSuggestionSnippet(), |
174 | 174 | $stParams ); |
175 | 175 | |
176 | 176 | $this->didYouMeanHtml = '<div class="searchdidyoumean">'.wfMsg('search-suggest',$suggestLink).'</div>'; |
— | — | @@ -947,7 +947,7 @@ |
948 | 948 | $this->powerSearchOptions()); |
949 | 949 | |
950 | 950 | $suggestLink = $sk->makeKnownLinkObj( $st, |
951 | | - htmlspecialchars( $textMatches->getSuggestionSnippet() ), |
| 951 | + $textMatches->getSuggestionSnippet(), |
952 | 952 | $stParams ); |
953 | 953 | |
954 | 954 | $wgOut->addHTML('<div class="searchdidyoumean">'.wfMsg('search-suggest',$suggestLink).'</div>'); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -468,7 +468,6 @@ |
469 | 469 | that STDIN can be used for page list |
470 | 470 | * Sanitizer::decodeCharReferences() now decodes the XHTML "'" character |
471 | 471 | entity (loosely related to bug 14365) |
472 | | -* Fix XSS in Special:Search with extended engine features ("did you mean") |
473 | 472 | |
474 | 473 | === API changes in 1.14 === |
475 | 474 | |
Index: trunk/extensions/MWSearch/MWSearch_body.php |
— | — | @@ -598,10 +598,10 @@ |
599 | 599 | array_unshift($points,0); |
600 | 600 | $suggestText = ""; |
601 | 601 | for($i=1;$i<count($points);$i+=2){ |
602 | | - $suggestText .= substr($sug,$points[$i-1],$points[$i]-$points[$i-1]); |
603 | | - $suggestText .= '<em>'.substr($sug,$points[$i],$points[$i+1]-$points[$i])."</em>"; |
| 602 | + $suggestText .= htmlspecialchars(substr($sug,$points[$i-1],$points[$i]-$points[$i-1])); |
| 603 | + $suggestText .= '<em>'.htmlspecialchars(substr($sug,$points[$i],$points[$i+1]-$points[$i]))."</em>"; |
604 | 604 | } |
605 | | - $suggestText .= substr($sug,end($points)); |
| 605 | + $suggestText .= htmlspecialchars(substr($sug,end($points))); |
606 | 606 | |
607 | 607 | $this->mSuggestionQuery = $this->replaceGenericPrefixes($sug); |
608 | 608 | $this->mSuggestionSnippet = $this->replaceGenericPrefixes($suggestText); |