Merge "Disallow top level domains in Cookie::validateCookieDomain()."
[lhc/web/wiklou.git] / includes / specials / SpecialVersion.php
index c9e2e18..8ca9e23 100644 (file)
@@ -211,7 +211,9 @@ class SpecialVersion extends SpecialPage {
                // wikimarkup can be used.
                $software = array();
                $software['[https://www.mediawiki.org/ MediaWiki]'] = self::getVersionLinked();
-               $software['[http://www.php.net/ PHP]'] = phpversion() . " (" . PHP_SAPI . ")";
+               $phpKey = wfIsHHVM() ? '[http://hhvm.com/ HHVM]' :
+                       '[http://www.php.net/ PHP]';
+               $software[$phpKey] = PHP_VERSION . " (" . PHP_SAPI . ")";
                $software[$dbr->getSoftwareLink()] = $dbr->getServerInfo();
 
                // Allow a hook to add/remove items.
@@ -305,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;
@@ -347,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() {
@@ -511,7 +513,7 @@ class SpecialVersion extends SpecialPage {
                        );
 
                        array_walk( $tags, function ( &$value ) {
-                               $value = '<' . htmlentities( $value ) . '>';
+                               $value = '<' . htmlspecialchars( $value ) . '>';
                        } );
                        $out .= $this->listToText( $tags );
                } else {
@@ -648,6 +650,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 );
@@ -666,7 +669,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 ) {