From ea45a55cd30ed59be609631572f27f938166e289 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 3 Sep 2007 19:58:05 +0000 Subject: [PATCH] * (bug 11115) API: Adding the SHA1 to the imageinfo query * Moving misplaced entry in RELEASE-NOTES --- RELEASE-NOTES | 3 ++- includes/api/ApiQueryImageInfo.php | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1862b1da37..abc8d26d1b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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) and 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 == diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 7566f722c5..da1a2d0c3f 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -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, -- 2.20.1