Made {{INT:}} a core parser function instead of a special case. The syntax and behavi...
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 30 Sep 2006 04:53:36 +0000 (04:53 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 30 Sep 2006 04:53:36 +0000 (04:53 +0000)
RELEASE-NOTES
includes/CoreParserFunctions.php
includes/Parser.php

index b56ce93..0f3c7dc 100644 (file)
@@ -237,6 +237,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Try to reconnect after transitory database errors in dumpTextPass.php
 * (bug 6023) Fixed mismatch of 0/NULL for wl_notificationtimestamp; now notification
   mails are working after 'Mark all pages visited' button on Special:Watchlist is clicked
+* Made {{INT:}} a core parser function instead of a special case. The syntax 
+  and behaviour is largely unchanged. 
 
 
 == Languages updated ==
index 326608e..2081b3f 100644 (file)
@@ -5,6 +5,14 @@
  */
 
 class CoreParserFunctions {
+       static function intFunction( $parser, $part1 = '' /*, ... */ ) {
+               if ( strval( $part1 ) !== '' ) {
+                       $args = array_slice( func_get_args(), 2 );
+                       return wfMsgReal( $part1, $args, true );
+               } else {
+                       return array( 'found' => false );
+               }
+       }
 
        static function ns( $parser, $part1 = '' ) {
                global $wgContLang;
index 7a84468..7332180 100644 (file)
@@ -139,6 +139,7 @@ class Parser
 
                $this->setHook( 'pre', array( $this, 'renderPreTag' ) );
 
+               $this->setFunctionHook( 'int', array( 'CoreParserFunctions', 'intFunction' ), SFH_NO_HASH );
                $this->setFunctionHook( 'ns', array( 'CoreParserFunctions', 'ns' ), SFH_NO_HASH );
                $this->setFunctionHook( 'urlencode', array( 'CoreParserFunctions', 'urlencode' ), SFH_NO_HASH );
                $this->setFunctionHook( 'lcfirst', array( 'CoreParserFunctions', 'lcfirst' ), SFH_NO_HASH );
@@ -2869,7 +2870,7 @@ class Parser
                        }
                }
 
-               # MSG, MSGNW, INT and RAW
+               # MSG, MSGNW and RAW
                if ( !$found ) {
                        # Check for MSGNW:
                        $mwMsgnw =& MagicWord::get( 'msgnw' );
@@ -2886,13 +2887,6 @@ class Parser
                        if ( $mwRaw->matchStartAndRemove( $part1 ) ) {
                                $forceRawInterwiki = true;
                        }
-                       
-                       # Check if it is an internal message
-                       $mwInt =& MagicWord::get( 'int' );
-                       if ( $mwInt->matchStartAndRemove( $part1 ) ) {
-                               $text = $linestart . wfMsgReal( $part1, $args, true );
-                               $found = true;
-                       }
                }
                wfProfileOut( __METHOD__.'-modifiers' );