From 455bb78b127d85bc3ad36806584efad7c46ada36 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 2 Dec 2009 12:28:27 +0000 Subject: [PATCH] API: Minor cleanup for r59258, general whitespace cleanup --- includes/api/ApiQueryInfo.php | 16 ++++++++++------ includes/api/ApiUpload.php | 6 ++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index b43b215c55..7381679313 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -331,6 +331,7 @@ class ApiQueryInfo extends ApiQueryBase { // Get normal protections for existing titles if(count($this->titles)) { + $this->resetQueryParams(); $this->addTables(array('page_restrictions', 'page')); $this->addWhere('page_id=pr_page'); $this->addFields(array('pr_page', 'pr_type', 'pr_level', @@ -505,8 +506,8 @@ class ApiQueryInfo extends ApiQueryBase { } /** - * Get information about watched status and put it in $watched - */ + * Get information about watched status and put it in $watched + */ private function getWatchedInfo() { global $wgUser; @@ -519,12 +520,15 @@ class ApiQueryInfo extends ApiQueryBase { $lb = new LinkBatch($this->titles); + $this->resetQueryParams(); $this->addTables(array('page', 'watchlist')); $this->addFields(array('page_title', 'page_namespace')); - $this->addWhere($lb->constructSet('page', $db)); - $this->addWhere('wl_title=page_title'); - $this->addWhere('wl_namespace=page_namespace'); - $this->addWhereFld('wl_user', $wgUser->getID()); + $this->addWhere(array( + $lb->constructSet('page', $db), + 'wl_namespace=page_namespace', + 'wl_title=page_title', + 'wl_user' => $wgUser->getID() + )); $res = $this->select(__METHOD__); diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index dbced92788..4aac35ed81 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -68,7 +68,7 @@ class ApiUpload extends ApiBase { */ // Check the session key if( !isset( $_SESSION['wsUploadData'][$this->mParams['sessionkey']] ) ) - return $this->dieUsageMsg( array( 'invalid-session-key' ) ); + return $this->dieUsageMsg( array( 'invalid-session-key' ) ); $this->mUpload = new UploadFromStash(); $this->mUpload->initialize( $this->mParams['filename'], @@ -246,7 +246,7 @@ class ApiUpload extends ApiBase { // Append imageinfo to the result $imParam = ApiQueryImageInfo::getPropertyNames(); - $result['imageinfo'] = ApiQueryImageInfo::getInfo( $file, + $result['imageinfo'] = ApiQueryImageInfo::getInfo( $file, array_flip( $imParam ), $this->getResult() ); return $result; @@ -322,5 +322,3 @@ class ApiUpload extends ApiBase { return __CLASS__ . ': $Id: ApiUpload.php 51812 2009-06-12 23:45:20Z dale $'; } } - - -- 2.20.1