From a1789ddde42033f1b05cc4929491214ee6e79383 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 17 Dec 2015 09:15:42 +0100 Subject: Update to MediaWiki 1.26.0 --- includes/api/ApiQueryWatchlistRaw.php | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'includes/api/ApiQueryWatchlistRaw.php') diff --git a/includes/api/ApiQueryWatchlistRaw.php b/includes/api/ApiQueryWatchlistRaw.php index 493c192a..fc7b80c5 100644 --- a/includes/api/ApiQueryWatchlistRaw.php +++ b/includes/api/ApiQueryWatchlistRaw.php @@ -83,6 +83,28 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase { ); } + if ( isset( $params['fromtitle'] ) ) { + list( $ns, $title ) = $this->prefixedTitlePartToKey( $params['fromtitle'] ); + $title = $this->getDB()->addQuotes( $title ); + $op = $params['dir'] == 'ascending' ? '>' : '<'; + $this->addWhere( + "wl_namespace $op $ns OR " . + "(wl_namespace = $ns AND " . + "wl_title $op= $title)" + ); + } + + if ( isset( $params['totitle'] ) ) { + list( $ns, $title ) = $this->prefixedTitlePartToKey( $params['totitle'] ); + $title = $this->getDB()->addQuotes( $title ); + $op = $params['dir'] == 'ascending' ? '<' : '>'; // Reversed from above! + $this->addWhere( + "wl_namespace $op $ns OR " . + "(wl_namespace = $ns AND " . + "wl_title $op= $title)" + ); + } + $sort = ( $params['dir'] == 'descending' ? ' DESC' : '' ); // Don't ORDER BY wl_namespace if it's constant in the WHERE clause if ( count( $params['namespace'] ) == 1 ) { @@ -149,7 +171,8 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase { ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_TYPE => array( 'changed', - ) + ), + ApiBase::PARAM_HELP_MSG_PER_VALUE => array(), ), 'show' => array( ApiBase::PARAM_ISMULTI => true, @@ -172,6 +195,12 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase { ), ApiBase::PARAM_HELP_MSG => 'api-help-param-direction', ), + 'fromtitle' => array( + ApiBase::PARAM_TYPE => 'string' + ), + 'totitle' => array( + ApiBase::PARAM_TYPE => 'string' + ), ); } -- cgit v1.2.3-54-g00ecf