Merge "SkinFactory: Improve documentation and comments"
[lhc/web/wiklou.git] / includes / specials / SpecialVersion.php
index a857da4..318ceb1 100644 (file)
@@ -212,7 +212,7 @@ class SpecialVersion extends SpecialPage {
                $software = array();
                $software['[https://www.mediawiki.org/ MediaWiki]'] = self::getVersionLinked();
                $phpKey = wfIsHHVM() ? '[http://hhvm.com/ HHVM]' :
-                       '[http://www.php.net/ PHP]';
+                       '[https://php.net/ PHP]';
                $software[$phpKey] = PHP_VERSION . " (" . PHP_SAPI . ")";
                $software[$dbr->getSoftwareLink()] = $dbr->getServerInfo();
 
@@ -307,7 +307,7 @@ class SpecialVersion extends SpecialPage {
        }
 
        /**
-        * @return string wgVersion + a link to subversion revision of svn BASE
+        * @return string Global wgVersion + a link to subversion revision of svn BASE
         */
        private static function getVersionLinkedSvn() {
                global $IP;
@@ -349,7 +349,7 @@ class SpecialVersion extends SpecialPage {
 
        /**
         * @since 1.22 Returns the HEAD date in addition to the sha1 and link
-        * @return bool|string wgVersion + HEAD sha1 stripped to the first 7 chars
+        * @return bool|string Global wgVersion + HEAD sha1 stripped to the first 7 chars
         *   with link and date, or false on failure
         */
        private static function getVersionLinkedGit() {
@@ -428,7 +428,11 @@ class SpecialVersion extends SpecialPage {
        function getExtensionCredits() {
                global $wgExtensionCredits;
 
-               if ( !count( $wgExtensionCredits ) ) {
+               if (
+                       count( $wgExtensionCredits ) === 0 ||
+                       // Skins are displayed separately, see getSkinCredits()
+                       ( count( $wgExtensionCredits ) === 1 && isset( $wgExtensionCredits['skin'] ) )
+               ) {
                        return '';
                }
 
@@ -476,6 +480,11 @@ class SpecialVersion extends SpecialPage {
         * @return string Wikitext
         */
        function getSkinCredits() {
+               global $wgExtensionCredits;
+               if ( !isset( $wgExtensionCredits['skin'] ) || count( $wgExtensionCredits['skin'] ) === 0 ) {
+                       return '';
+               }
+
                $out = Xml::element(
                                'h2',
                                array( 'id' => 'mw-version-skin' ),
@@ -650,6 +659,7 @@ class SpecialVersion extends SpecialPage {
 
                if ( isset( $extension['path'] ) ) {
                        global $IP;
+                       $extensionPath = dirname( $extension['path'] );
                        if ( $this->coreId == '' ) {
                                wfDebug( 'Looking up core head id' );
                                $coreHeadSHA1 = self::getGitHeadSha1( $IP );
@@ -668,7 +678,6 @@ class SpecialVersion extends SpecialPage {
 
                        if ( !$vcsVersion ) {
                                wfDebug( "Getting VCS info for extension $extensionName" );
-                               $extensionPath = dirname( $extension['path'] );
                                $gitInfo = new GitInfo( $extensionPath );
                                $vcsVersion = $gitInfo->getHeadSHA1();
                                if ( $vcsVersion !== false ) {