From 7f71612ac8210113944d0f6999d9b679a8c72430 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Sat, 23 Oct 2010 15:40:55 +0000 Subject: [PATCH] Added iiprop=parsedcomment to prop=imageinfo, similar to prop=revisions --- RELEASE-NOTES | 1 + includes/api/ApiQueryImageInfo.php | 34 ++++++++++++++++++------------ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 62128cbb13..6ec093795d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 0b02bf138b..1973d93a75 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -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', -- 2.20.1