Added iiprop=parsedcomment to prop=imageinfo, similar to prop=revisions
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 23 Oct 2010 15:40:55 +0000 (15:40 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 23 Oct 2010 15:40:55 +0000 (15:40 +0000)
RELEASE-NOTES
includes/api/ApiQueryImageInfo.php

index 62128cb..6ec0937 100644 (file)
@@ -435,6 +435,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   if integer out of range (breaking change!)
 * (bug 24792) API help for action=purge sometimes wrongly stated whether a
   POST request was needed due to cache pollution
+* Added iiprop=parsedcomment to prop=imageinfo, similar to prop=revisions
 
 === Languages updated in 1.17 ===
 
index 0b02bf1..1973d93 100644 (file)
@@ -242,6 +242,12 @@ class ApiQueryImageInfo extends ApiQueryBase {
                if ( isset( $prop['comment'] ) ) {
                        $vals['comment'] = $file->getDescription();
                }
+               if ( isset( $prop['parsedcomment'] ) ) {
+                       global $wgUser;
+                       $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( 
+                                       $file->getDescription(), $file->getTitle() );
+               }
+               
                if ( isset( $prop['sha1'] ) ) {
                        $vals['sha1'] = wfBaseConvert( $file->getSha1(), 36, 16, 40 );
                }
@@ -337,6 +343,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                        'user',
                        'userid',
                        'comment',
+                       'parsedcomment',
                        'url',
                        'size',
                        'dimensions', // For backwards compatibility with Allimages
@@ -354,19 +361,20 @@ class ApiQueryImageInfo extends ApiQueryBase {
                return array(
                        'prop' => array(
                                'What image information to get:',
-                               ' timestamp    - Adds timestamp for the uploaded version',
-                               ' user         - Adds the user who uploaded the image version',
-                               ' userid       - Add the user id that uploaded the image version',
-                               ' comment      - 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',
-                               ' dimensions   - Alias for size',
-                               ' sha1         - Adds sha1 hash for the image',
-                               ' mime         - Adds MIME of the image',
-                               ' thumbmime    - Adss MIME of the image thumbnail (requires url)',
-                               ' metadata     - Lists EXIF metadata for the version of the image',
-                               ' archivename  - Adds the file name of the archive version for non-latest versions',
-                               ' bitdepth     - Adds the bit depth of the version',
+                               ' timestamp     - Adds timestamp for the uploaded version',
+                               ' user          - Adds the user who uploaded the image version',
+                               ' userid        - Add the user id that uploaded the image version',
+                               ' 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',
+                               ' dimensions    - Alias for size',
+                               ' sha1          - Adds sha1 hash for the image',
+                               ' mime          - Adds MIME of the image',
+                               ' thumbmime     - Adss MIME of the image thumbnail (requires url)',
+                               ' metadata      - Lists EXIF metadata for the version of the image',
+                               ' archivename   - Adds the file name of the archive version for non-latest versions',
+                               ' bitdepth      - Adds the bit depth of the version',
             ),
                        'limit' => 'How many image revisions to return',
                        'start' => 'Timestamp to start listing from',