summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialLinkSearch.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialLinkSearch.php')
-rw-r--r--includes/specials/SpecialLinkSearch.php32
1 files changed, 19 insertions, 13 deletions
diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php
index bef859a2..53db6f87 100644
--- a/includes/specials/SpecialLinkSearch.php
+++ b/includes/specials/SpecialLinkSearch.php
@@ -43,14 +43,20 @@ class LinkSearchPage extends QueryPage {
}
function execute( $par ) {
- global $wgOut, $wgRequest, $wgUrlProtocols, $wgMiserMode, $wgLang;
+ global $wgUrlProtocols, $wgMiserMode;
+
$this->setHeaders();
- $wgOut->allowClickjacking();
+ $this->outputHeader();
+
+ $out = $this->getOutput();
+ $out->allowClickjacking();
- $target = $wgRequest->getVal( 'target', $par );
- $namespace = $wgRequest->getIntorNull( 'namespace', null );
+ $request = $this->getRequest();
+ $target = $request->getVal( 'target', $par );
+ $namespace = $request->getIntorNull( 'namespace', null );
$protocols_list = array();
+
foreach( $wgUrlProtocols as $prot ) {
if ( $prot !== '//' ) {
$protocols_list[] = $prot;
@@ -79,9 +85,10 @@ class LinkSearchPage extends QueryPage {
$protocol = '';
}
- $out->addWikiMsg( 'linksearch-text', '<nowiki>' . $this->getLanguage()->commaList( $protocols_list ) . '</nowiki>' );
+ $out->addWikiMsg( 'linksearch-text', '<nowiki>' . $this->getLang()->commaList( $wgUrlProtocols ) . '</nowiki>' );
+
$s = Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) .
- Html::hidden( 'title', $self->getPrefixedDbKey() ) .
+ Html::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) .
'<fieldset>' .
Xml::element( 'legend', array(), wfMsg( 'linksearch' ) ) .
Xml::inputLabel( wfMsg( 'linksearch-pat' ), 'target', 'target', 50, $target ) . ' ';
@@ -92,7 +99,7 @@ class LinkSearchPage extends QueryPage {
$s .= Xml::submitButton( wfMsg( 'linksearch-ok' ) ) .
'</fieldset>' .
Xml::closeElement( 'form' );
- $wgOut->addHTML( $s );
+ $out->addHTML( $s );
if( $target != '' ) {
$this->setParams( array(
@@ -101,7 +108,7 @@ class LinkSearchPage extends QueryPage {
'protocol' => $protocol ) );
parent::execute( $par );
if( $this->mMungedQuery === false )
- $wgOut->addWikiMsg( 'linksearch-error' );
+ $out->addWikiMsg( 'linksearch-error' );
}
}
@@ -172,8 +179,8 @@ class LinkSearchPage extends QueryPage {
function formatResult( $skin, $result ) {
$title = Title::makeTitle( $result->namespace, $result->title );
$url = $result->url;
- $pageLink = $skin->linkKnown( $title );
- $urlLink = $skin->makeExternalLink( $url, $url );
+ $pageLink = Linker::linkKnown( $title );
+ $urlLink = Linker::makeExternalLink( $url, $url );
return wfMsgHtml( 'linksearch-line', $urlLink, $pageLink );
}
@@ -182,14 +189,13 @@ class LinkSearchPage extends QueryPage {
* Override to check query validity.
*/
function doQuery( $offset = false, $limit = false ) {
- global $wgOut;
list( $this->mMungedQuery, ) = LinkSearchPage::mungeQuery( $this->mQuery, $this->mProt );
if( $this->mMungedQuery === false ) {
- $wgOut->addWikiMsg( 'linksearch-error' );
+ $this->getOutput()->addWikiMsg( 'linksearch-error' );
} else {
// For debugging
// Generates invalid xhtml with patterns that contain --
- //$wgOut->addHTML( "\n<!-- " . htmlspecialchars( $this->mMungedQuery ) . " -->\n" );
+ //$this->getOutput()->addHTML( "\n<!-- " . htmlspecialchars( $this->mMungedQuery ) . " -->\n" );
parent::doQuery( $offset, $limit );
}
}