diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
commit | a2190ac74dd4d7080b12bab90e552d7aa81209ef (patch) | |
tree | 8b31f38de9882d18df54cf8d9e0de74167a094eb /includes/api/ApiQueryWatchlistRaw.php | |
parent | 15e69f7b20b6596b9148030acce5b59993b95a45 (diff) | |
parent | 257401d8b2cf661adf36c84b0e3fd1cf85e33c22 (diff) |
Merge branch 'mw-1.26'
Diffstat (limited to 'includes/api/ApiQueryWatchlistRaw.php')
-rw-r--r-- | includes/api/ApiQueryWatchlistRaw.php | 31 |
1 files changed, 30 insertions, 1 deletions
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' + ), ); } |