Commit stuff from my w/c
[lhc/web/wiklou.git] / includes / api / ApiQueryImageInfo.php
index 37e216a..2701730 100644 (file)
@@ -312,8 +312,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                                                $thumbFile = UnregisteredLocalFile::newFromPath( $mto->getPath(), false );
                                                $vals['thumbmime'] = $thumbFile->getMimeType();
                                        }
-                               }
-                               if ( $mto && $mto->isError() ) {
+                               } else if ( $mto && $mto->isError() ) {
                                        $vals['thumberror'] = $mto->toText();
                                }
                        }
@@ -462,7 +461,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                                ' comment       - Comment on the version',
                                ' parsedcomment - Parse the comment on the version',
                                ' url           - Gives URL to the image and the description page',
-                               ' size          - Adds the size of the image in bytes and the height and width',
+                               ' size          - Adds the size of the image in bytes and the height, width and page count (if applicable)',
                                ' dimensions    - Alias for size',
                                ' sha1          - Adds SHA-1 hash for the image',
                                ' mime          - Adds MIME type of the image',
@@ -500,7 +499,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
        public function getPossibleErrors() {
                $p = $this->getModulePrefix();
                return array_merge( parent::getPossibleErrors(), array(
-                       array( 'code' => 'iiurlwidth', 'info' => 'iiurlheight cannot be used without iiurlwidth' ),
+                       array( 'code' => "{$p}urlwidth", 'info' => "{$p}urlheight cannot be used without {$p}urlwidth" ),
                        array( 'code' => 'urlparam', 'info' => "Invalid value for {$p}urlparam" ),
                        array( 'code' => 'urlparam_no_width', 'info' => "{$p}urlparam requires {$p}urlwidth" ),
                        array( 'code' => 'urlparam_urlwidth_mismatch', 'info' => "The width set in {$p}urlparm doesnt't " .