FU r106514: use base 16 SHA-1 to be consistent with image info
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 18 Dec 2011 16:35:45 +0000 (16:35 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 18 Dec 2011 16:35:45 +0000 (16:35 +0000)
includes/api/ApiQueryDeletedrevs.php
includes/api/ApiQueryRevisions.php

index 8f286ce..0422eba 100644 (file)
@@ -236,7 +236,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                                $rev['len'] = $row->ar_len;
                        }
                        if ( $fld_sha1 ) {
-                               $rev['sha1'] = $row->ar_sha1;
+                               $rev['sha1'] = wfBaseConvert( $row->ar_sha1, 36, 16, 40 );
                        }
                        if ( $fld_content ) {
                                ApiResult::setContent( $rev, Revision::getRevisionText( $row ) );
@@ -347,7 +347,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                                ' parsedcomment  - Adds the parsed comment of the revision',
                                ' minor          - Tags if the revision is minor',
                                ' len            - Adds the length (bytes) of the revision',
-                               ' sha1           - Adds the SHA-1 (base 36) of the revision',
+                               ' sha1           - Adds the SHA-1 (base 16) of the revision',
                                ' content        - Adds the content of the revision',
                                ' token          - Gives the edit token',
                        ),
index 6d1fe3f..7fac077 100644 (file)
@@ -414,7 +414,7 @@ class ApiQueryRevisions extends ApiQueryBase {
                }
 
                if ( $this->fld_sha1 ) {
-                       $vals['sha1'] = $revision->getSha1();
+                       $vals['sha1'] = wfBaseConvert( $revision->getSha1(), 36, 16, 40 );
                }
 
                if ( $this->fld_comment || $this->fld_parsedcomment ) {
@@ -606,7 +606,7 @@ class ApiQueryRevisions extends ApiQueryBase {
                                ' user           - User that made the revision',
                                ' userid         - User id of revision creator',
                                ' size           - Length (bytes) of the revision',
-                               ' sha1           - SHA-1 (base 36) the revision',
+                               ' sha1           - SHA-1 (base 16) the revision',
                                ' comment        - Comment by the user for revision',
                                ' parsedcomment  - Parsed comment by the user for the revision',
                                ' content        - Text of the revision',