Add semantic tags to license info text
[lhc/web/wiklou.git] / includes / specials / SpecialVersion.php
index 272f074..1088d72 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 ) {
@@ -162,7 +169,9 @@ class SpecialVersion extends SpecialPage {
                $ret .= '<div class="plainlinks">';
                $ret .= "__NOTOC__
                " . self::getCopyrightAndAuthorList() . "\n
-               " . wfMessage( 'version-license-info' )->text();
+               " . '<div class="mw-version-license-info">' .
+               wfMessage( 'version-license-info' )->text() .
+               '</div>';
                $ret .= '</div>';
 
                return str_replace( "\t\t", '', $ret ) . "\n";
@@ -196,6 +205,7 @@ class SpecialVersion extends SpecialPage {
                        'Roan Kattouw', 'Trevor Parscal', 'Bryan Tong Minh', 'Sam Reed',
                        'Victor Vasiliev', 'Rotem Liss', 'Platonides', 'Antoine Musso',
                        'Timo Tijhof', 'Daniel Kinzler', 'Jeroen De Dauw', 'Brad Jorsch',
+                       'Bartosz DziewoƄski', 'Ed Sanders', 'Moriel Schottlender',
                        $othersLink, $translatorsLink
                ];
 
@@ -504,7 +514,7 @@ class SpecialVersion extends SpecialPage {
                                // in their proper section
                                continue;
                        }
-                       $authors = array_map( function( $arr ) {
+                       $authors = array_map( function ( $arr ) {
                                // If a homepage is set, link to it
                                if ( isset( $arr['homepage'] ) ) {
                                        return "[{$arr['homepage']} {$arr['name']}]";
@@ -725,7 +735,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 ) {
@@ -831,7 +843,7 @@ class SpecialVersion extends SpecialPage {
                // Finally! Create the table
                $html = Html::openElement( 'tr', [
                                'class' => 'mw-version-ext',
-                               'id' => Sanitizer::escapeId( 'mw-version-ext-' . $type . '-' . $extension['name'] )
+                               'id' => Sanitizer::escapeIdForAttribute( 'mw-version-ext-' . $type . '-' . $extension['name'] )
                        ]
                );