summaryrefslogtreecommitdiff
path: root/includes/specials
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-01-12 13:42:29 +0100
committerPierre Schmitz <pierre@archlinux.de>2012-01-12 13:42:29 +0100
commitba0fc4fa20067528effd4802e53ceeb959640825 (patch)
tree4f62217349d3afa39dbba3f7e19dac0aecb344f6 /includes/specials
parentca32f08966f1b51fcb19460f0996bb0c4048e6fe (diff)
Update to MediaWiki 1.18.1
Diffstat (limited to 'includes/specials')
-rw-r--r--includes/specials/SpecialAllmessages.php10
-rw-r--r--includes/specials/SpecialBlockList.php6
-rw-r--r--includes/specials/SpecialLinkSearch.php32
-rw-r--r--includes/specials/SpecialMovepage.php2
4 files changed, 30 insertions, 20 deletions
diff --git a/includes/specials/SpecialAllmessages.php b/includes/specials/SpecialAllmessages.php
index 2214b4ab..24815825 100644
--- a/includes/specials/SpecialAllmessages.php
+++ b/includes/specials/SpecialAllmessages.php
@@ -62,9 +62,6 @@ class SpecialAllmessages extends SpecialPage {
$out->addModuleStyles( 'mediawiki.special' );
- $this->filter = $request->getVal( 'filter', 'all' );
- $this->prefix = $request->getVal( 'prefix', '' );
-
$this->table = new AllmessagesTablePager(
$this,
array(),
@@ -118,10 +115,13 @@ class AllmessagesTablePager extends TablePager {
$this->langcode = $this->lang->getCode();
$this->foreign = $this->langcode != $wgContLang->getCode();
- if( $wgRequest->getVal( 'filter', 'all' ) === 'all' ){
+ $request = $wgRequest;
+
+ $this->filter = $request->getVal( 'filter', 'all' );
+ if( $this->filter === 'all' ){
$this->custom = null; // So won't match in either case
} else {
- $this->custom = ($wgRequest->getVal( 'filter' ) == 'unmodified');
+ $this->custom = ($this->filter == 'unmodified');
}
$prefix = $wgLang->ucfirst( $wgRequest->getVal( 'prefix', '' ) );
diff --git a/includes/specials/SpecialBlockList.php b/includes/specials/SpecialBlockList.php
index ebeb5874..04787a65 100644
--- a/includes/specials/SpecialBlockList.php
+++ b/includes/specials/SpecialBlockList.php
@@ -426,7 +426,11 @@ class HTMLBlockedUsersItemSelect extends HTMLSelectField {
return true;
}
- if ( !in_array( $value, $this->mParams['options'] ) ) {
+ // Let folks pick an explicit limit not from our list, as long as it's a real numbr.
+ if ( !in_array( $value, $this->mParams['options'] ) && $value == intval( $value ) && $value > 0 ) {
+ // This adds the explicitly requested limit value to the drop-down,
+ // then makes sure it's sorted correctly so when we output the list
+ // later, the custom option doesn't just show up last.
$this->mParams['options'][ $this->mParent->getLanguage()->formatNum( $value ) ] = intval($value);
asort( $this->mParams['options'] );
}
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 );
}
}
diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php
index 7ac7eba4..ec7f4024 100644
--- a/includes/specials/SpecialMovepage.php
+++ b/includes/specials/SpecialMovepage.php
@@ -75,7 +75,7 @@ class MovePageForm extends UnlistedSpecialPage {
$permErrors = $this->oldTitle->getUserPermissionsErrors( 'move', $wgUser );
if( !empty( $permErrors ) ) {
// Auto-block user's IP if the account was "hard" blocked
- $user->spreadAnyEditBlock();
+ $wgUser->spreadAnyEditBlock();
$this->getOutput()->showPermissionsErrorPage( $permErrors );
return;
}