hard coded requested imageinfo prop in api upload result (to avoid static call to...
authorMichael Dale <dale@users.mediawiki.org>
Sat, 22 Aug 2009 06:36:19 +0000 (06:36 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Sat, 22 Aug 2009 06:36:19 +0000 (06:36 +0000)
includes/api/ApiUpload.php

index 57f3541..af4c571 100644 (file)
@@ -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;
        }