From d9022f63880ce039446fba8364f68e656b7bf4cb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 3 May 2012 13:01:35 +0200 Subject: Update to MediaWiki 1.19.0 --- includes/api/ApiQueryFilearchive.php | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'includes/api/ApiQueryFilearchive.php') diff --git a/includes/api/ApiQueryFilearchive.php b/includes/api/ApiQueryFilearchive.php index e746a6c4..be995f30 100644 --- a/includes/api/ApiQueryFilearchive.php +++ b/includes/api/ApiQueryFilearchive.php @@ -26,11 +26,6 @@ * @file */ -if ( !defined( 'MEDIAWIKI' ) ) { - // Eclipse helper - will be ignored in production - require_once( 'ApiQueryBase.php' ); -} - /** * Query module to enumerate all deleted files. * @@ -43,9 +38,9 @@ class ApiQueryFilearchive extends ApiQueryBase { } public function execute() { - global $wgUser; + $user = $this->getUser(); // Before doing anything at all, let's check permissions - if ( !$wgUser->isAllowed( 'deletedhistory' ) ) { + if ( !$user->isAllowed( 'deletedhistory' ) ) { $this->dieUsage( 'You don\'t have permission to view deleted file information', 'permissiondenied' ); } @@ -110,7 +105,7 @@ class ApiQueryFilearchive extends ApiQueryBase { } } - if ( !$wgUser->isAllowed( 'suppressrevision' ) ) { + if ( !$user->isAllowed( 'suppressrevision' ) ) { // Filter out revisions that the user is not allowed to see. There // is no way to indicate that we have skipped stuff because the // continuation parameter is fa_name @@ -166,7 +161,7 @@ class ApiQueryFilearchive extends ApiQueryBase { if ( $fld_description ) { $file['description'] = $row->fa_description; if ( isset( $prop['parseddescription'] ) ) { - $file['parseddescription'] = $wgUser->getSkin()->formatComment( + $file['parseddescription'] = Linker::formatComment( $row->fa_description, $title ); } } @@ -285,11 +280,12 @@ class ApiQueryFilearchive extends ApiQueryBase { ) ); } - protected function getExamples() { + public function getExamples() { return array( - 'Simple Use', - ' Show a list of all deleted files', - ' api.php?action=query&list=filearchive', + 'api.php?action=query&list=filearchive' => array( + 'Simple Use', + 'Show a list of all deleted files', + ), ); } -- cgit v1.2.3-54-g00ecf