From: Kaldari Date: Tue, 25 Dec 2012 06:40:41 +0000 (-0800) Subject: Creating new GetDoubleUnderscoreIDs hook X-Git-Tag: 1.31.0-rc.0~21211^2 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=4fd26bdd023faf99d2edd4235c60812728884c69;p=lhc%2Fweb%2Fwiklou.git Creating new GetDoubleUnderscoreIDs hook Creating a new hook so that doubleunderscore (behaviour switch) magic words can be defined from Extensions (so that I can solve bug 6754 from an extension rather than from core, as requested). Change-Id: I734a4a1639be61052924838b19ed9db93a28e50b --- diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21 index 608d7bb65a..f58c61f785 100644 --- a/RELEASE-NOTES-1.21 +++ b/RELEASE-NOTES-1.21 @@ -65,6 +65,7 @@ production. group has no key in wgDebugLogGroups, that will help triage the default log. * (bug 24620) Add types to LogFormatter. * jQuery JSON upgraded from 2.3 to 2.4.0. +* Added GetDoubleUnderscoreIDs hook, for modifying the list of magic words. === Bug fixes in 1.21 === * (bug 40353) SpecialDoubleRedirect should support interwiki redirects. diff --git a/docs/hooks.txt b/docs/hooks.txt index 399af41d28..701c312554 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1075,6 +1075,10 @@ $query: query options passed to Title::getCanonicalURL() $title: Title object that we need to get a sortkey for &$sortkey: Sortkey to use. +'GetDoubleUnderscoreIDs': modify the list of behavior switch (double underscore) +magic words. Called by MagicWord. +&$doubleUnderscoreIDs: array of strings + 'GetFullURL': modify fully-qualified URLs used in redirects/export/offsite data $title: Title object of page $url: string value as output (out parameter, can modify) diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 357eae4a33..7cf59e9597 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -282,6 +282,7 @@ class MagicWord { */ static function getDoubleUnderscoreArray() { if ( is_null( self::$mDoubleUnderscoreArray ) ) { + wfRunHooks( 'GetDoubleUnderscoreIDs', array( &self::$mDoubleUnderscoreIDs ) ); self::$mDoubleUnderscoreArray = new MagicWordArray( self::$mDoubleUnderscoreIDs ); } return self::$mDoubleUnderscoreArray;