(bug 5167) Add SUBPAGENAMEE
[lhc/web/wiklou.git] / includes / MagicWord.php
index 87a332b..b48b574 100644 (file)
@@ -69,6 +69,9 @@ $magicWords = array(
        'MAG_UC',
        'MAG_FULLPAGENAME',
        'MAG_FULLPAGENAMEE',
+       'MAG_RAW',
+       'MAG_SUBPAGENAME',
+       'MAG_SUBPAGENAMEE',
 );
 if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
        wfRunHooks( 'MagicWordMagicWords', array( &$magicWords ) );
@@ -101,6 +104,8 @@ $wgVariableIDs = array(
        MAG_CURRENTWEEK,
        MAG_CURRENTDOW,
        MAG_REVISIONID,
+       MAG_SUBPAGENAME,
+       MAG_SUBPAGENAMEE
 );
 if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
        wfRunHooks( 'MagicWordwgVariableIDs', array( &$wgVariableIDs ) );
@@ -198,6 +203,18 @@ class MagicWord {
                return $this->mRegex;
        }
 
+       /**
+        * Gets the regexp case modifier to use, i.e. i or nothing, to be used if
+        * one is using MagicWord::getBaseRegex(), otherwise it'll be included in
+        * the complete expression
+        */
+       function getRegexCase() {
+               if ( $this->mRegex === '' )
+                       $this->initRegex();
+
+               return $this->mCaseSensitive ? '' : 'i';
+       }
+
        /**
         * Gets a regex matching the word, if it is at the string start
         */