From 97cf74d1c908a384a9e7ceb84998428a8cd68430 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 19 Jun 2005 16:09:00 +0000 Subject: [PATCH] * A new magic word, {{PATH}}, returns $wgScriptPath --- RELEASE-NOTES | 1 + includes/MagicWord.php | 2 ++ includes/Parser.php | 4 +++- languages/Language.php | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 080133fac1..0ac6e60e1d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -298,6 +298,7 @@ Various bugfixes, small features, and a few experimental things: * (bug 2277) Added Friulian language file * (bug 2457) The "Special page" href now links to the current special page rather than to "". +* A new magic word, {{PATH}}, returns $wgScriptPath * 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 224facbe08..a0bff753e8 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -52,6 +52,7 @@ define('MAG_NOCONTENTCONVERT', 37); define('MAG_CURRENTWEEK', 38); define('MAG_CURRENTDOW', 39); define('MAG_REVISIONID', 40); +define('MAG_PATH', 41); $wgVariableIDs = array( MAG_CURRENTMONTH, @@ -65,6 +66,7 @@ $wgVariableIDs = array( MAG_NUMBEROFARTICLES, MAG_SITENAME, MAG_SERVER, + MAG_PATH, MAG_PAGENAME, MAG_PAGENAMEE, MAG_NAMESPACE, diff --git a/includes/Parser.php b/includes/Parser.php index 11677117f0..d5e6a6918d 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1851,7 +1851,7 @@ class Parser * @access private */ function getVariableValue( $index ) { - global $wgContLang, $wgSitename, $wgServer, $wgArticle; + global $wgContLang, $wgSitename, $wgServer, $wgArticle, $wgScriptPath; /** * Some of these require message or data lookups and can be @@ -1896,6 +1896,8 @@ class Parser return $wgSitename; case MAG_SERVER: return $wgServer; + case MAG_PATH: + return $wgScriptPath; default: return NULL; } diff --git a/languages/Language.php b/languages/Language.php index a5eaee3639..3fd52b5cf8 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -230,6 +230,7 @@ $wgLanguageNamesEn =& $wgLanguageNames; MAG_LOCALURL => array( 0, 'LOCALURL:' ), MAG_LOCALURLE => array( 0, 'LOCALURLE:' ), MAG_SERVER => array( 0, 'SERVER' ), + MAG_PATH => array( 0, 'PATH' ), MAG_GRAMMAR => array( 0, 'GRAMMAR:' ), MAG_NOTITLECONVERT => array( 0, '__NOTITLECONVERT__', '__NOTC__'), MAG_NOCONTENTCONVERT => array( 0, '__NOCONTENTCONVERT__', '__NOCC__'), -- 2.20.1