(bug 43137) Don't return the sha1 of revisions through the API if the content is...
authorAlex Monk <krenair@gmail.com>
Fri, 14 Dec 2012 22:33:06 +0000 (22:33 +0000)
committerAlex Monk <krenair@gmail.com>
Mon, 17 Dec 2012 17:08:35 +0000 (17:08 +0000)
Change-Id: Ic2cad08cdae428d04dbdc31665c531d8a4759cbb

RELEASE-NOTES-1.21
includes/api/ApiQueryRevisions.php

index 78ef1df..0b2efb8 100644 (file)
@@ -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 ===
 
index 66ff3f0..1d46b7a 100644 (file)
@@ -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 ) {