When a visitor accesses an info page of an existing file, base-36 sha1 value of this file will displayed in the table of basic information.
Bug: T181651
Change-Id: Ib8cae3e4070a186e28e8625556d3c510af0701c2
];
}
+ // Display image SHA-1 value
+ if ( $title->inNamespace( NS_FILE ) ) {
+ $fileObj = wfFindFile( $title );
+ if ( $fileObj !== false ) {
+ $output = $fileObj->getSha1();
+ $pageInfo['header-basic'][] = [
+ $this->msg( 'pageinfo-file-hash' ),
+ $output
+ ];
+ }
+ }
+
// Page protection
$pageInfo['header-restrictions'] = [];
"pageinfo-category-subcats": "Number of subcategories",
"pageinfo-category-files": "Number of files",
"pageinfo-user-id": "User ID",
+ "pageinfo-file-hash": "Hash value",
"markaspatrolleddiff": "Mark as patrolled",
"markaspatrolledlink": "[$1]",
"markaspatrolledtext": "Mark this page as patrolled",
"pageinfo-category-subcats": "See also:\n* {{msg-mw|Pageinfo-category-pages}}\n* {{msg-mw|Pageinfo-category-files}}",
"pageinfo-category-files": "See also:\n* {{msg-mw|Pageinfo-category-pages}}\n* {{msg-mw|Pageinfo-category-subcats}}",
"pageinfo-user-id": "The numeric ID for a user\n{{Identical|User ID}}",
+ "pageinfo-file-hash": "Base-36 SHA-1 value of the file",
"markaspatrolleddiff": "{{doc-actionlink}}\nSee also:\n* {{msg-mw|Markaspatrolledtext}}\n{{Identical|Mark as patrolled}}",
"markaspatrolledlink": "{{notranslate}}\nParameters:\n* $1 - link which has text {{msg-mw|Markaspatrolledtext}}",
"markaspatrolledtext": "{{doc-actionlink}}\nSee also:\n* {{msg-mw|Markaspatrolleddiff}}",