From: Ævar Arnfjörð Bjarmason Date: Fri, 24 Jun 2005 02:54:52 +0000 (+0000) Subject: * Added a new magic word, {{SERVERNAME}}, that returns $wgServerName, useful X-Git-Tag: 1.5.0beta1~67 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=9048d60b5789c5158693ed73d54b6c1f7414a4fe;p=lhc%2Fweb%2Fwiklou.git * Added a new magic word, {{SERVERNAME}}, that returns $wgServerName, useful for things like bug 1825 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7ec1db5a75..f2ab04efdd 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/includes/MagicWord.php b/includes/MagicWord.php index b2818824cd..3abb02638e 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -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, diff --git a/includes/Parser.php b/includes/Parser.php index 487c0caf86..1921d6c7bf 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -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: diff --git a/languages/Language.php b/languages/Language.php index 02cd00a804..4996c07f41 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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__'),