Creating new GetDoubleUnderscoreIDs hook
authorKaldari <rkaldari@wikimedia.org>
Tue, 25 Dec 2012 06:40:41 +0000 (22:40 -0800)
committerOri Livneh <ori@wikimedia.org>
Tue, 25 Dec 2012 23:29:43 +0000 (15:29 -0800)
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

RELEASE-NOTES-1.21
docs/hooks.txt
includes/MagicWord.php

index 608d7bb..f58c61f 100644 (file)
@@ -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.
index 399af41..701c312 100644 (file)
@@ -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)
index 357eae4..7cf59e9 100644 (file)
@@ -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;