Merge "Add 3D filetype for STL files"
[lhc/web/wiklou.git] / includes / specials / SpecialVersion.php
index 2cd492e..caa0e1f 100644 (file)
@@ -78,9 +78,16 @@ class SpecialVersion extends SpecialPage {
                // Now figure out what to do
                switch ( strtolower( $parts[0] ) ) {
                        case 'credits':
+                               $out->addModuleStyles( 'mediawiki.special.version' );
+
                                $wikiText = '{{int:version-credits-not-found}}';
                                if ( $extName === 'MediaWiki' ) {
                                        $wikiText = file_get_contents( $IP . '/CREDITS' );
+                                       // Put the contributor list into columns
+                                       $wikiText = str_replace(
+                                               [ '<!-- BEGIN CONTRIBUTOR LIST -->', '<!-- END CONTRIBUTOR LIST -->' ],
+                                               [ '<div class="mw-version-credits">', '</div>' ],
+                                               $wikiText );
                                } elseif ( ( $extNode !== null ) && isset( $extNode['path'] ) ) {
                                        $file = $this->getExtAuthorsFileName( dirname( $extNode['path'] ) );
                                        if ( $file ) {
@@ -725,7 +732,9 @@ class SpecialVersion extends SpecialPage {
                                }
                        }
                        $cache = wfGetCache( CACHE_ANYTHING );
-                       $memcKey = wfMemcKey( 'specialversion-ext-version-text', $extension['path'], $this->coreId );
+                       $memcKey = $cache->makeKey(
+                               'specialversion-ext-version-text', $extension['path'], $this->coreId
+                       );
                        list( $vcsVersion, $vcsLink, $vcsDate ) = $cache->get( $memcKey );
 
                        if ( !$vcsVersion ) {
@@ -785,12 +794,12 @@ class SpecialVersion extends SpecialPage {
                if ( isset( $extension['name'] ) ) {
                        $licenseName = null;
                        if ( isset( $extension['license-name'] ) ) {
-                               $licenseName = $out->parseInline( $extension['license-name'] );
+                               $licenseName = new HtmlArmor( $out->parseInline( $extension['license-name'] ) );
                        } elseif ( $this->getExtLicenseFileName( $extensionPath ) ) {
-                               $licenseName = $this->msg( 'version-ext-license' )->escaped();
+                               $licenseName = $this->msg( 'version-ext-license' )->text();
                        }
                        if ( $licenseName !== null ) {
-                               $licenseLink = Linker::link(
+                               $licenseLink = $this->getLinkRenderer()->makeLink(
                                        $this->getPageTitle( 'License/' . $extension['name'] ),
                                        $licenseName,
                                        [
@@ -956,6 +965,7 @@ class SpecialVersion extends SpecialPage {
         */
        public function listAuthors( $authors, $extName, $extDir ) {
                $hasOthers = false;
+               $linkRenderer = $this->getLinkRenderer();
 
                $list = [];
                foreach ( (array)$authors as $item ) {
@@ -963,9 +973,9 @@ class SpecialVersion extends SpecialPage {
                                $hasOthers = true;
 
                                if ( $extName && $this->getExtAuthorsFileName( $extDir ) ) {
-                                       $text = Linker::link(
+                                       $text = $linkRenderer->makeLink(
                                                $this->getPageTitle( "Credits/$extName" ),
-                                               $this->msg( 'version-poweredby-others' )->escaped()
+                                               $this->msg( 'version-poweredby-others' )->text()
                                        );
                                } else {
                                        $text = $this->msg( 'version-poweredby-others' )->escaped();
@@ -982,9 +992,9 @@ class SpecialVersion extends SpecialPage {
                }
 
                if ( $extName && !$hasOthers && $this->getExtAuthorsFileName( $extDir ) ) {
-                       $list[] = $text = Linker::link(
+                       $list[] = $text = $linkRenderer->makeLink(
                                $this->getPageTitle( "Credits/$extName" ),
-                               $this->msg( 'version-poweredby-others' )->escaped()
+                               $this->msg( 'version-poweredby-others' )->text()
                        );
                }