From b9b85843572bf283f48285001e276ba7e61b63f6 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 22 Feb 2009 13:37:51 +0100 Subject: updated to MediaWiki 1.14.0 --- includes/api/ApiQueryAllimages.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'includes/api/ApiQueryAllimages.php') diff --git a/includes/api/ApiQueryAllimages.php b/includes/api/ApiQueryAllimages.php index 26cbc368..ea83c667 100644 --- a/includes/api/ApiQueryAllimages.php +++ b/includes/api/ApiQueryAllimages.php @@ -61,10 +61,11 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase { $params = $this->extractRequestParams(); // Image filters - if (!is_null($params['from'])) - $this->addWhere('img_name>=' . $db->addQuotes($this->titleToKey($params['from']))); + $dir = ($params['dir'] == 'descending' ? 'older' : 'newer'); + $from = (is_null($params['from']) ? null : $this->titlePartToKey($params['from'])); + $this->addWhereRange('img_name', $dir, $from, null); if (isset ($params['prefix'])) - $this->addWhere("img_name LIKE '" . $db->escapeLike($this->titleToKey($params['prefix'])) . "%'"); + $this->addWhere("img_name LIKE '" . $db->escapeLike($this->titlePartToKey($params['prefix'])) . "%'"); if (isset ($params['minsize'])) { $this->addWhere('img_size>=' . intval($params['minsize'])); @@ -109,10 +110,10 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase { if (is_null($resultPageSet)) { $file = $repo->newFileFromRow( $row ); - - $data[] = ApiQueryImageInfo::getInfo( $file, $prop, $result ); + $data[] = array_merge(array('name' => $row->img_name), + ApiQueryImageInfo::getInfo($file, $prop, $result)); } else { - $data[] = Title::makeTitle( NS_IMAGE, $row->img_name ); + $data[] = Title::makeTitle(NS_FILE, $row->img_name); } } $db->freeResult($res); @@ -162,7 +163,8 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase { 'dimensions', // Obsolete 'mime', 'sha1', - 'metadata' + 'metadata', + 'bitdepth', ), ApiBase :: PARAM_DFLT => 'timestamp|url', ApiBase :: PARAM_ISMULTI => true @@ -200,6 +202,6 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase { } public function getVersion() { - return __CLASS__ . ': $Id: ApiQueryAllimages.php 37909 2008-07-22 13:26:15Z catrope $'; + return __CLASS__ . ': $Id: ApiQueryAllimages.php 44121 2008-12-01 17:14:30Z vyznev $'; } } -- cgit v1.2.3-54-g00ecf