From ce2e97807c8251da199464aa4e3df699049d3a43 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Sun, 17 Feb 2008 18:43:31 +0000 Subject: [PATCH] ApiQueryBase.php: Allow queries to have a where range that does not match the range field --- RELEASE-NOTES | 1 + includes/api/ApiQueryBase.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a69336238b..006c6afbe7 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -540,6 +540,7 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API * Added siprop=namespacealiases to meta=siteinfo * Made multiple values for ucuser possible in list=usercontribs * (bug 12944) Added cmstart and cmend parameters to list=categorymembers +* Allow queries to have a where range that does not match the range field === Languages updated in 1.12 === diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index 69492dbe97..f964ea98d7 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -110,8 +110,9 @@ abstract class ApiQueryBase extends ApiBase { if (!is_null($end)) $this->addWhere($field . $before . $db->addQuotes($end)); - - $this->addOption('ORDER BY', $field . ($isDirNewer ? '' : ' DESC')); + + if (!isset($this->options['ORDER BY'])) + $this->addOption('ORDER BY', $field . ($isDirNewer ? '' : ' DESC')); } protected function addOption($name, $value = null) { -- 2.20.1