(bug 43184) bogus script path in Special:Version
[lhc/web/wiklou.git] / includes / specials / SpecialVersion.php
index 7ace5f8..01a12c0 100644 (file)
@@ -263,9 +263,13 @@ class SpecialVersion extends SpecialPage {
         */
        private static function getwgVersionLinked() {
                global $wgVersion;
-               $versionParts = array();
-               preg_match( "/^(\d+\.\d+)/", $wgVersion, $versionParts );
-               return "[https://www.mediawiki.org/wiki/MediaWiki_{$versionParts[1]} $wgVersion]";
+               $versionUrl = "";
+               if( wfRunHooks( 'SpecialVersionVersionUrl', array( $wgVersion, &$versionUrl ) ) ) {
+                       $versionParts = array();
+                       preg_match( "/^(\d+\.\d+)/", $wgVersion, $versionParts );
+                       $versionUrl = "https://www.mediawiki.org/wiki/MediaWiki_{$versionParts[1]}";
+               }
+               return "[$versionUrl $wgVersion]";
        }
 
        /**
@@ -771,15 +775,17 @@ class SpecialVersion extends SpecialPage {
                return $repo->getHeadSHA1();
        }
 
+
        /**
         * Get the list of entry points and their URLs
         * @return string Wikitext
         */
        public function getEntryPointInfo() {
                global $wgArticlePath, $wgScriptPath;
+               $scriptPath = $wgScriptPath ? $wgScriptPath : "/";
                $entryPoints = array(
                        'version-entrypoints-articlepath' => $wgArticlePath,
-                       'version-entrypoints-scriptpath' => $wgScriptPath,
+                       'version-entrypoints-scriptpath' => $scriptPath,
                        'version-entrypoints-index-php' => wfScript( 'index' ),
                        'version-entrypoints-api-php' => wfScript( 'api' ),
                        'version-entrypoints-load-php' => wfScript( 'load' ),