From: Alex Monk Date: Fri, 14 Dec 2012 22:33:06 +0000 (+0000) Subject: (bug 43137) Don't return the sha1 of revisions through the API if the content is... X-Git-Tag: 1.31.0-rc.0~21276^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=9072a50845c0a026c0d3fae9056e5f60a4689ae2;p=lhc%2Fweb%2Fwiklou.git (bug 43137) Don't return the sha1 of revisions through the API if the content is revdel'd Change-Id: Ic2cad08cdae428d04dbdc31665c531d8a4759cbb --- 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 ) {