* (bug 11115) API: Adding the SHA1 to the imageinfo query
authorRoan Kattouw <catrope@users.mediawiki.org>
Mon, 3 Sep 2007 19:58:05 +0000 (19:58 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Mon, 3 Sep 2007 19:58:05 +0000 (19:58 +0000)
* Moving misplaced entry in RELEASE-NOTES

RELEASE-NOTES
includes/api/ApiQueryImageInfo.php

index 1862b1d..abc8d26 100644 (file)
@@ -427,7 +427,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Preventing the TOC from appearing in Special:Statistics
 * (bug 11082) Fix check for fully-specced table names in Database::tableName
 * (bug 11067) Fix regression in upload conflict thumbnail display
-* (bug 11072) Fix regression in API image history query
 * (bug 10985) Resolved cached entries on Special:DoubleRedirects were being
   supressed, breaking paging - now strikes out "fixed" results
 * (bug 8393) <sup> and <sub> need to be preserved (without attributes) for
@@ -495,6 +494,8 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API
 * Treat underscores as spaces for `aufrom` and `auprefix` parameters
 * Added edit/delete/... token retrieval to prop=info
 * Added meta=userinfo - logged-in user information, group membership, rights
+* (bug 11072) Fix regression in API image history query
+* (bug 11115) Adding SHA1 hash to imageinfo query
 
 == Maintenance script changes since 1.10 ==
 
index 7566f72..da1a2d0 100644 (file)
@@ -50,6 +50,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                $fld_comment = isset($prop['comment']);
                $fld_url = isset($prop['url']);
                $fld_size = isset($prop['size']);
+               $fld_sha1 = isset($prop['sha1']);
 
                $pageIds = $this->getPageSet()->getAllTitlesByNamespace();
                if (!empty($pageIds[NS_IMAGE])) {
@@ -87,6 +88,9 @@ class ApiQueryImageInfo extends ApiQueryBase {
                                                        $vals['url'] = $isCur ? $img->getURL() : $img->getArchiveUrl($row["oi_archive_name"]);
                                                if ($fld_comment)
                                                        $vals['comment'] = $row["{$prefix}_description"];
+                                                       
+                                               if ($fld_sha1)
+                                                       $vals['sha1'] = wfBaseConvert($row["{$prefix}_sha1"], 36, 16, 40);
 
                                                $data[] = $vals;
                                                
@@ -119,6 +123,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                                        'comment',
                                        'url',
                                        'size',
+                                       'sha1'
                                )
                        ),
                        'history' => false,