From: Michael Dale Date: Sat, 22 Aug 2009 06:36:19 +0000 (+0000) Subject: hard coded requested imageinfo prop in api upload result (to avoid static call to... X-Git-Tag: 1.31.0-rc.0~40131 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=cf7448516a17455639cce922ccd6bcf7c405861a;p=lhc%2Fweb%2Fwiklou.git hard coded requested imageinfo prop in api upload result (to avoid static call to non-static: ApiQueryImageInfo::getAllowedParams(); --- 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; }