From 24b465161ce9cb9d77207d2bc921114f13b33e8c Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sat, 23 Apr 2011 16:03:40 +0000 Subject: [PATCH] * (bug 27344) add drprefix param to list=deletedrevs --- RELEASE-NOTES | 1 + includes/api/ApiQueryDeletedrevs.php | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 28be438eff..56fa6fbc1e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -347,6 +347,7 @@ PHP if you have not done so prior to upgrading MediaWiki. * (bug 28672) give information about misermode on api * (bug 28558) Add iw_api and iw_wikiid to meta=siteinfo&siprop=interwikimap * (bug 26882) Allow listing of indefinite protections with the api +* (bug 27344) add drprefix param to list=deletedrevs === Languages updated in 1.18 === diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index c9775ef701..7731154309 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -146,6 +146,10 @@ class ApiQueryDeletedrevs extends ApiQueryBase { $from = is_null( $params['from'] ) ? null : $this->titleToKey( $params['from'] ); $to = is_null( $params['to'] ) ? null : $this->titleToKey( $params['to'] ); $this->addWhereRange( 'ar_title', $dir, $from, $to ); + + if ( isset( $params['prefix'] ) ) { + $this->addWhere( 'ar_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) ); + } } if ( !is_null( $params['user'] ) ) { @@ -282,6 +286,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase { ), 'from' => null, 'to' => null, + 'prefix' => null, 'continue' => null, 'unique' => false, 'user' => array( @@ -327,6 +332,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase { 'dir' => $this->getDirectionDescription( $this->getModulePrefix(), ' (1,2)' ), 'from' => 'Start listing at this title (3)', 'to' => 'Stop listing at this title (3)', + 'prefix' => 'Search for all page titles that begin with this value (3)', 'limit' => 'The maximum amount of revisions to list', 'prop' => array( 'Which properties to get', @@ -350,12 +356,13 @@ class ApiQueryDeletedrevs extends ApiQueryBase { } public function getDescription() { + $p = $this->getModulePrefix(); return array( 'List deleted revisions.', 'This module operates in three modes:', '1) List deleted revisions for the given title(s), sorted by timestamp', '2) List deleted contributions for the given user, sorted by timestamp (no titles specified)', - '3) List all deleted revisions in the given namespace, sorted by title and timestamp (no titles specified, druser not set)', + "3) List all deleted revisions in the given namespace, sorted by title and timestamp (no titles specified, {$p}user not set)", 'Certain parameters only apply to some modes and are ignored in others.', 'For instance, a parameter marked (1) only applies to mode 1 and is ignored in modes 2 and 3', ); -- 2.20.1