From cf7448516a17455639cce922ccd6bcf7c405861a Mon Sep 17 00:00:00 2001 From: Michael Dale Date: Sat, 22 Aug 2009 06:36:19 +0000 Subject: [PATCH] hard coded requested imageinfo prop in api upload result (to avoid static call to non-static: ApiQueryImageInfo::getAllowedParams(); --- includes/api/ApiUpload.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index 57f3541f4d..af4c5719bc 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -237,13 +237,13 @@ class ApiUpload extends ApiBase { $warnings = $this->mUpload->checkWarnings(); if( $warnings ) { $this->getResult()->setIndexedTagName( $warnings, 'warning' ); - //also add index to duplicate: + //also add index to duplicate: if(isset($warnings['duplicate'])) $this->getResult()->setIndexedTagName( $warnings['duplicate'], 'duplicate'); - + if(isset($warnings['exists'])) $this->getResult()->setIndexedTagName( $warnings['exists'], 'exists'); - + $result['result'] = 'Warning'; $result['warnings'] = $warnings; if( isset( $result['filewasdeleted'] ) ) @@ -274,12 +274,21 @@ class ApiUpload extends ApiBase { // Append imageinfo to the result - // might be a cleaner way to call this: - $imParam = ApiQueryImageInfo::getAllowedParams(); - $imProp = $imParam['prop'][ApiBase::PARAM_TYPE]; - $result['imageinfo'] = ApiQueryImageInfo::getInfo( $file, - array_flip( $imProp ), - $this->getResult() ); + //get all the image properties: + $imParam = Array('timestamp', + 'user', + 'comment', + 'url', + 'size', + 'sha1', + 'mime', + 'metadata', + 'archivename', + 'bitdepth'); + $result['imageinfo'] = ApiQueryImageInfo::getInfo( $file, + array_flip( $imParam ), + $this->getResult() ); + return $result; } -- 2.20.1