Use OutputPage::addWikiTextAsInterface() instead of untidy addWikiText()
[lhc/web/wiklou.git] / includes / specials / SpecialMediaStatistics.php
index 943fa57..b6812bc 100644 (file)
@@ -143,7 +143,7 @@ class MediaStatisticsPage extends QueryPage {
                        $this->outputTableEnd();
                        // add total size of all files
                        $this->outputMediaType( 'total' );
-                       $this->getOutput()->addWikiText(
+                       $this->getOutput()->addWikiTextAsInterface(
                                $this->msg( 'mediastatistics-allbytes' )
                                        ->numParams( $this->totalSize )
                                        ->sizeParams( $this->totalSize )
@@ -157,7 +157,7 @@ class MediaStatisticsPage extends QueryPage {
         */
        protected function outputTableEnd() {
                $this->getOutput()->addHTML( Html::closeElement( 'table' ) );
-               $this->getOutput()->addWikiText(
+               $this->getOutput()->addWikiTextAsInterface(
                                $this->msg( 'mediastatistics-bytespertype' )
                                        ->numParams( $this->totalPerType )
                                        ->sizeParams( $this->totalPerType )
@@ -182,7 +182,7 @@ class MediaStatisticsPage extends QueryPage {
                        [],
                        $linkRenderer->makeLink( $mimeSearch, $mime )
                );
-               $row .= Html::element(
+               $row .= Html::rawElement(
                        'td',
                        [],
                        $this->getExtensionList( $mime )
@@ -245,7 +245,7 @@ class MediaStatisticsPage extends QueryPage {
                $extArray = explode( ' ', $exts );
                $extArray = array_unique( $extArray );
                foreach ( $extArray as &$ext ) {
-                       $ext = '.' . $ext;
+                       $ext = htmlspecialchars( '.' . $ext );
                }
 
                return $this->getLanguage()->commaList( $extArray );
@@ -363,8 +363,8 @@ class MediaStatisticsPage extends QueryPage {
                $this->totalCount = $this->totalBytes = 0;
                foreach ( $res as $row ) {
                        $mediaStats = $this->splitFakeTitle( $row->title );
-                       $this->totalCount += isset( $mediaStats[2] ) ? $mediaStats[2] : 0;
-                       $this->totalBytes += isset( $mediaStats[3] ) ? $mediaStats[3] : 0;
+                       $this->totalCount += $mediaStats[2] ?? 0;
+                       $this->totalBytes += $mediaStats[3] ?? 0;
                }
                $res->seek( 0 );
        }