// pageinfo-header-basic, pageinfo-header-edits, pageinfo-header-restrictions,
// pageinfo-header-properties, pageinfo-category-info
$content .= $this->makeHeader(
- $this->msg( "pageinfo-${header}" )->escaped(),
+ $this->msg( "pageinfo-${header}" )->text(),
"mw-pageinfo-${header}"
) . "\n";
$table = "\n";
* Adds a table to the content that will be added to the output.
*
* @param string $content The content that will be added to the output
- * @param string $table The table
+ * @param string $table
* @return string The content with the table added
*/
protected function addTable( $content, $table ) {
];
}
+ // Display image SHA-1 value
+ if ( $title->inNamespace( NS_FILE ) ) {
+ $fileObj = wfFindFile( $title );
+ if ( $fileObj !== false ) {
+ // Convert the base-36 sha1 value obtained from database to base-16
+ $output = Wikimedia\base_convert( $fileObj->getSha1(), 36, 16, 40 );
+ $pageInfo['header-basic'][] = [
+ $this->msg( 'pageinfo-file-hash' ),
+ $output
+ ];
+ }
+ }
+
// Page protection
$pageInfo['header-restrictions'] = [];