Merge "Treat phpdbg as run from the command line when checking PHP_SAPI"
[lhc/web/wiklou.git] / includes / actions / InfoAction.php
index 68dda37..a8a8317 100644 (file)
@@ -128,7 +128,7 @@ class InfoAction extends FormlessAction {
                        // 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";
@@ -153,6 +153,7 @@ class InfoAction extends FormlessAction {
         * Creates a header that can be added to the output.
         *
         * @param string $header The header text.
+        * @param string $canonicalId
         * @return string The HTML.
         */
        protected function makeHeader( $header, $canonicalId ) {
@@ -436,6 +437,18 @@ class InfoAction extends FormlessAction {
                        ];
                }
 
+               // 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'] = [];
 
@@ -848,7 +861,7 @@ class InfoAction extends FormlessAction {
                $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
 
                # Sift for real versus user names
-               /** @var $user User */
+               /** @var User $user */
                foreach ( $contributors as $user ) {
                        $page = $user->isAnon()
                                ? SpecialPage::getTitleFor( 'Contributions', $user->getName() )