* Added a new magic word, {{SERVERNAME}}, that returns $wgServerName, useful
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Fri, 24 Jun 2005 02:54:52 +0000 (02:54 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Fri, 24 Jun 2005 02:54:52 +0000 (02:54 +0000)
  for things like bug 1825

RELEASE-NOTES
includes/MagicWord.php
includes/Parser.php
languages/Language.php

index 7ec1db5..f2ab04e 100644 (file)
@@ -299,6 +299,7 @@ Various bugfixes, small features, and a few experimental things:
   rather than to "".
 * (bug 1120) Updated the Czech translation
 * A new magic word, {{SCRIPTPATH}}, returns $wgScriptPath
+* A new magic word, {{SERVERNAME}}, returns $wgServerName
 * Special:Imagelist displays titles with " " instead of "_"
 * Less gratuitous munging of content sample in delete summary
 * badaccess/badaccesstext to supercede sysop*, developer* messages
index b281882..3abb026 100644 (file)
@@ -53,6 +53,7 @@ define('MAG_CURRENTWEEK',             38);
 define('MAG_CURRENTDOW',               39);
 define('MAG_REVISIONID',               40);
 define('MAG_SCRIPTPATH',               41);
+define('MAG_SERVERNAME',               42);
 
 $wgVariableIDs = array(
        MAG_CURRENTMONTH,
@@ -66,6 +67,7 @@ $wgVariableIDs = array(
        MAG_NUMBEROFARTICLES,
        MAG_SITENAME,
        MAG_SERVER,
+       MAG_SERVERNAME,
        MAG_SCRIPTPATH,
        MAG_PAGENAME,
        MAG_PAGENAMEE,
index 487c0ca..1921d6c 100644 (file)
@@ -1844,7 +1844,7 @@ class Parser
         * @access private
         */
        function getVariableValue( $index ) {
-               global $wgContLang, $wgSitename, $wgServer, $wgArticle, $wgScriptPath;
+               global $wgContLang, $wgSitename, $wgServer, $wgServerName, $wgArticle, $wgScriptPath;
                
                /**
                 * Some of these require message or data lookups and can be
@@ -1889,6 +1889,8 @@ class Parser
                                return $wgSitename;
                        case MAG_SERVER:
                                return $wgServer;
+                       case MAG_SERVERNAME:
+                               return $wgServerName;
                        case MAG_SCRIPTPATH:
                                return $wgScriptPath;
                        default:
index 02cd00a..4996c07 100644 (file)
@@ -228,6 +228,7 @@ $wgLanguageNamesEn =& $wgLanguageNames;
        MAG_LOCALURL             => array( 0,    'LOCALURL:'              ),
        MAG_LOCALURLE            => array( 0,    'LOCALURLE:'             ),
        MAG_SERVER               => array( 0,    'SERVER'                 ),
+       MAG_SERVERNAME           => array( 0,    'SERVERNAME'             ),
        MAG_SCRIPTPATH           => array( 0,    'SCRIPTPATH'             ),
        MAG_GRAMMAR              => array( 0,    'GRAMMAR:'               ),
        MAG_NOTITLECONVERT       => array( 0,    '__NOTITLECONVERT__', '__NOTC__'),