* @subpackage SpecialPage
*/
+/** */
require_once( 'SearchEngine.php' );
+require_once( 'Revision.php' );
-function wfSpecialSearch( $par='' ) {
+/**
+ * Entry point
+ *
+ * @param string $par (default '')
+ */
+function wfSpecialSearch( $par = '' ) {
global $wgRequest, $wgUser;
$search = $wgRequest->getText( 'search', $par );
}
}
-
+/**
+ * @todo document
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
class SpecialSearch {
+
/**
* Set up basic search parameters from the request and user settings.
* Typically you'll pass $wgRequest and $wgUser.
$editurl = $t->escapeLocalURL( 'action=edit' );
}
}
- # FIXME: HTML in wiki message
- $wgOut->addHTML( '<p>' . wfMsg('nogomatch', $editurl, htmlspecialchars( $term ) ) . "</p>\n" );
+ $wgOut->addWikiText( wfMsg('nogomatch', $term) );
return $this->showResults( $term );
}
global $wgDisableTextSearch;
if ( $wgDisableTextSearch ) {
+ global $wgForwardSearchUrl;
+ if( $wgForwardSearchUrl ) {
+ $url = str_replace( '$1', urlencode( $term ), $wgForwardSearchUrl );
+ $wgOut->redirect( $url );
+ return;
+ }
global $wgInputEncoding;
$wgOut->addHTML( wfMsg( 'searchdisabled' ) );
$wgOut->addHTML( wfMsg( 'googlesearch',
wfProfileIn( $fname );
global $wgUser, $wgContLang;
- $t = Title::makeTitle( $row->cur_namespace, $row->cur_title );
+ $t = Title::makeTitle( $row->page_namespace, $row->page_title );
if( is_null( $t ) ) {
wfProfileOut( $fname );
return "<!-- Broken link in search result -->\n";
if ( '' == $contextchars ) { $contextchars = 50; }
$link = $sk->makeKnownLinkObj( $t, '' );
- $size = wfMsg( 'nbytes', strlen( $row->cur_text ) );
+ $text = Revision::getRevisionText( $row );
+ $size = wfMsg( 'nbytes', strlen( $text ) );
- $lines = explode( "\n", $row->cur_text );
+ $lines = explode( "\n", $text );
$max = IntVal( $contextchars ) + 1;
$pat1 = "/(.*)($terms)(.{0,$max})/i";