* @param string $term
*/
public function showResults( $term ) {
- global $wgOut, $wgDisableTextSearch, $wgContLang;
+ global $wgOut, $wgUser, $wgDisableTextSearch, $wgContLang;
wfProfileIn( __METHOD__ );
+ $sk = $wgUser->getSkin();
+
$this->searchEngine = SearchEngine::create();
$search =& $this->searchEngine;
$search->setLimitOffset( $this->limit, $this->offset );
array( 'search' => $textMatches->getSuggestionQuery(), 'fulltext' => wfMsg('search') ),
$this->powerSearchOptions()
);
- $suggestLink = '<a href="'.$st->escapeLocalURL($stParams).'">'.
- $textMatches->getSuggestionSnippet().'</a>';
+ $suggestLink = $sk->makeKnownLinkObj( $st,
+ htmlspecialchars( $textMatches->getSuggestionSnippet() ),
+ $stParams );
$this->didYouMeanHtml = '<div class="searchdidyoumean">'.wfMsg('search-suggest',$suggestLink).'</div>';
}
* @param array $terms terms to highlight
*/
protected function showHit( $result, $terms ) {
- global $wgContLang, $wgLang;
+ global $wgContLang, $wgLang, $wgUser;
wfProfileIn( __METHOD__ );
if( $result->isBrokenTitle() ) {
return "<!-- Broken link in search result -->\n";
}
+ $sk = $wgUser->getSkin();
$t = $result->getTitle();
$link = $this->sk->makeKnownLinkObj( $t, $result->getTitleSnippet($terms));
array('search' => wfMsgForContent('searchrelated').':'.$t->getPrefixedText(),
'fulltext' => wfMsg('search') ));
- $related = ' -- <a href="'.$st->escapeLocalURL($stParams).'">'.
- wfMsg('search-relatedarticle').'</a>';
+ $related = ' -- ' . $sk->makeKnownLinkObj( $st,
+ wfMsg('search-relatedarticle'), $stParams );
}
// Include a thumbnail for media files...
'fulltext' => wfMsg('search')),
$this->powerSearchOptions());
- $suggestLink = '<a href="'.$st->escapeLocalURL($stParams).'">'.
- $textMatches->getSuggestionSnippet().'</a>';
+ $suggestLink = $sk->makeKnownLinkObj( $st,
+ htmlspecialchars( $textMatches->getSuggestionSnippet() ),
+ $stParams );
$wgOut->addHTML('<div class="searchdidyoumean">'.wfMsg('search-suggest',$suggestLink).'</div>');
}
array('search' => wfMsgForContent('searchrelated').':'.$t->getPrefixedText(),
'fulltext' => wfMsg('search') ));
- $related = ' -- <a href="'.$st->escapeLocalURL($stParams).'">'.
- wfMsg('search-relatedarticle').'</a>';
+ $related = ' -- ' . $sk->makeKnownLinkObj( $st,
+ wfMsg('search-relatedarticle'), $stParams );
}
// Include a thumbnail for media files...