From 9072a50845c0a026c0d3fae9056e5f60a4689ae2 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Fri, 14 Dec 2012 22:33:06 +0000 Subject: [PATCH] (bug 43137) Don't return the sha1 of revisions through the API if the content is revdel'd Change-Id: Ic2cad08cdae428d04dbdc31665c531d8a4759cbb --- RELEASE-NOTES-1.21 | 2 ++ includes/api/ApiQueryRevisions.php | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21 index 78ef1dfddf..0b2efb832e 100644 --- a/RELEASE-NOTES-1.21 +++ b/RELEASE-NOTES-1.21 @@ -124,6 +124,8 @@ production. * (bug 41042) Revert change to action=parse&page=... behavior when the page does not exist. * (bug 27202) Add timestamp sort to list=allimages. +* (bug 43137) Don't return the sha1 of revisions through the API if the content is + revision-deleted === Languages updated in 1.21 === diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 66ff3f09fb..1d46b7a544 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -439,12 +439,14 @@ class ApiQueryRevisions extends ApiQueryBase { } } - if ( $this->fld_sha1 ) { + if ( $this->fld_sha1 && !$revision->isDeleted( Revision::DELETED_TEXT ) ) { if ( $revision->getSha1() != '' ) { $vals['sha1'] = wfBaseConvert( $revision->getSha1(), 36, 16, 40 ); } else { $vals['sha1'] = ''; } + } elseif ( $this->fld_sha1 ) { + $vals['sha1hidden'] = ''; } if ( $this->fld_contentmodel ) { -- 2.20.1