From ba0fc4fa20067528effd4802e53ceeb959640825 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 12 Jan 2012 13:42:29 +0100 Subject: Update to MediaWiki 1.18.1 --- includes/specials/SpecialAllmessages.php | 10 +++++----- includes/specials/SpecialBlockList.php | 6 +++++- includes/specials/SpecialLinkSearch.php | 32 +++++++++++++++++++------------- includes/specials/SpecialMovepage.php | 2 +- 4 files changed, 30 insertions(+), 20 deletions(-) (limited to 'includes/specials') 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', '' . $this->getLanguage()->commaList( $protocols_list ) . '' ); + $out->addWikiMsg( 'linksearch-text', '' . $this->getLang()->commaList( $wgUrlProtocols ) . '' ); + $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() ) . '
' . 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' ) ) . '
' . 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\n" ); + //$this->getOutput()->addHTML( "\n\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; } -- cgit v1.2.2