From 63601400e476c6cf43d985f3e7b9864681695ed4 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 18 Jan 2013 16:46:04 +0100 Subject: Update to MediaWiki 1.20.2 this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024 --- includes/api/ApiPurge.php | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) (limited to 'includes/api/ApiPurge.php') diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index 9e9320fb..9fedaf1b 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -88,13 +88,13 @@ class ApiPurge extends ApiBase { if ( !$user->pingLimiter() ) { global $wgParser, $wgEnableParserCache; - $popts = ParserOptions::newFromContext( $this->getContext() ); + $popts = $page->makeParserOptions( 'canonical' ); $p_result = $wgParser->parse( $page->getRawText(), $title, $popts, true, true, $page->getLatest() ); # Update the links tables - $u = new LinksUpdate( $title, $p_result ); - $u->doUpdate(); + $updates = $p_result->getSecondaryDataUpdates( $title ); + DataUpdate::runUpdates( $updates ); $r['linkupdate'] = ''; @@ -103,7 +103,8 @@ class ApiPurge extends ApiBase { $pcache->save( $p_result, $page, $popts ); } } else { - $this->setWarning( $this->parseMsg( array( 'actionthrottledtext' ) ) ); + $error = $this->parseMsg( array( 'actionthrottledtext' ) ); + $this->setWarning( $error['info'] ); $forceLinkUpdate = false; } } @@ -133,6 +134,34 @@ class ApiPurge extends ApiBase { ); } + public function getResultProperties() { + return array( + ApiBase::PROP_LIST => true, + '' => array( + 'ns' => array( + ApiBase::PROP_TYPE => 'namespace', + ApiBase::PROP_NULLABLE => true + ), + 'title' => array( + ApiBase::PROP_TYPE => 'string', + ApiBase::PROP_NULLABLE => true + ), + 'pageid' => array( + ApiBase::PROP_TYPE => 'integer', + ApiBase::PROP_NULLABLE => true + ), + 'revid' => array( + ApiBase::PROP_TYPE => 'integer', + ApiBase::PROP_NULLABLE => true + ), + 'invalid' => 'boolean', + 'missing' => 'boolean', + 'purged' => 'boolean', + 'linkupdate' => 'boolean' + ) + ); + } + public function getDescription() { return array( 'Purge the cache for the given titles.', 'Requires a POST request if the user is not logged in.' @@ -143,7 +172,6 @@ class ApiPurge extends ApiBase { $psModule = new ApiPageSet( $this ); return array_merge( parent::getPossibleErrors(), - array( array( 'cantpurge' ), ), $psModule->getPossibleErrors() ); } -- cgit v1.2.3-54-g00ecf