Merge "Fix spelling in nan date formats"
[lhc/web/wiklou.git] / includes / parser / ParserOptions.php
index 211fcd6..009b18a 100644 (file)
@@ -94,6 +94,11 @@ class ParserOptions {
         * Maximum number of nodes touched by PPFrame::expand()
         */
        var $mMaxPPNodeCount;
+
+       /**
+        * Maximum number of nodes generated by Preprocessor::preprocessToObj()
+        */
+       var $mMaxGeneratedPPNodeCount;
        
        /**
         * Maximum recursion depth in PPFrame::expand()
@@ -149,6 +154,16 @@ class ParserOptions {
         */
        var $mPreSaveTransform = true;
 
+       /**
+        * Whether content conversion should be disabled
+        */
+       var $mDisableContentConversion;
+
+       /**
+        * Whether title conversion should be disabled
+        */
+       var $mDisableTitleConversion;
+
        /**
         * Automatically number headings?
         */
@@ -219,6 +234,7 @@ class ParserOptions {
        function getTargetLanguage()                { return $this->mTargetLanguage; }
        function getMaxIncludeSize()                { return $this->mMaxIncludeSize; }
        function getMaxPPNodeCount()                { return $this->mMaxPPNodeCount; }
+       function getMaxGeneratedPPNodeCount()       { return $this->mMaxGeneratedPPNodeCount; }
        function getMaxPPExpandDepth()              { return $this->mMaxPPExpandDepth; }
        function getMaxTemplateDepth()              { return $this->mMaxTemplateDepth; }
        /* @since 1.20 */
@@ -228,6 +244,8 @@ class ParserOptions {
        function getEnableLimitReport()             { return $this->mEnableLimitReport; }
        function getCleanSignatures()               { return $this->mCleanSignatures; }
        function getExternalLinkTarget()            { return $this->mExternalLinkTarget; }
+       function getDisableContentConversion()      { return $this->mDisableContentConversion; }
+       function getDisableTitleConversion()        { return $this->mDisableTitleConversion; }
        function getMath()                          { $this->optionUsed( 'math' );
                                                                                                  return $this->mMath; }
        function getThumbSize()                     { $this->optionUsed( 'thumbsize' );
@@ -307,6 +325,7 @@ class ParserOptions {
        function setTargetLanguage( $x )            { return wfSetVar( $this->mTargetLanguage, $x, true ); }
        function setMaxIncludeSize( $x )            { return wfSetVar( $this->mMaxIncludeSize, $x ); }
        function setMaxPPNodeCount( $x )            { return wfSetVar( $this->mMaxPPNodeCount, $x ); }
+       function setMaxGeneratedPPNodeCount( $x )   { return wfSetVar( $this->mMaxGeneratedPPNodeCount, $x ); }
        function setMaxTemplateDepth( $x )          { return wfSetVar( $this->mMaxTemplateDepth, $x ); }
        /* @since 1.20 */
        function setExpensiveParserFunctionLimit( $x ) { return wfSetVar( $this->mExpensiveParserFunctionLimit, $x ); }
@@ -316,6 +335,8 @@ class ParserOptions {
        function setTimestamp( $x )                 { return wfSetVar( $this->mTimestamp, $x ); }
        function setCleanSignatures( $x )           { return wfSetVar( $this->mCleanSignatures, $x ); }
        function setExternalLinkTarget( $x )        { return wfSetVar( $this->mExternalLinkTarget, $x ); }
+       function disableContentConversion( $x = true ) { return wfSetVar( $this->mDisableContentConversion, $x ); }
+       function disableTitleConversion( $x = true ) { return wfSetVar( $this->mDisableTitleConversion, $x ); }
        function setMath( $x )                      { return wfSetVar( $this->mMath, $x ); }
        function setUserLang( $x )                  {
                if ( is_string( $x ) ) {
@@ -404,7 +425,8 @@ class ParserOptions {
                global $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages,
                        $wgAllowExternalImagesFrom, $wgEnableImageWhitelist, $wgAllowSpecialInclusion,
                        $wgMaxArticleSize, $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth,
-                       $wgCleanSignatures, $wgExternalLinkTarget, $wgExpensiveParserFunctionLimit;
+                       $wgCleanSignatures, $wgExternalLinkTarget, $wgExpensiveParserFunctionLimit,
+                       $wgMaxGeneratedPPNodeCount, $wgDisableLangConversion, $wgDisableTitleConversion;
 
                wfProfileIn( __METHOD__ );
 
@@ -416,11 +438,14 @@ class ParserOptions {
                $this->mAllowSpecialInclusion = $wgAllowSpecialInclusion;
                $this->mMaxIncludeSize = $wgMaxArticleSize * 1024;
                $this->mMaxPPNodeCount = $wgMaxPPNodeCount;
+               $this->mMaxGeneratedPPNodeCount = $wgMaxGeneratedPPNodeCount;
                $this->mMaxPPExpandDepth = $wgMaxPPExpandDepth;
                $this->mMaxTemplateDepth = $wgMaxTemplateDepth;
                $this->mExpensiveParserFunctionLimit = $wgExpensiveParserFunctionLimit;
                $this->mCleanSignatures = $wgCleanSignatures;
                $this->mExternalLinkTarget = $wgExternalLinkTarget;
+               $this->mDisableContentConversion = $wgDisableLangConversion;
+               $this->mDisableTitleConversion = $wgDisableLangConversion || $wgDisableTitleConversion;
 
                $this->mUser = $user;
                $this->mNumberHeadings = $user->getOption( 'numberheadings' );