X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FParserOptions.php;h=009b18a13eb6c16dc5db94c3620af1492d75d74c;hb=37683c7ca08f40745ce79f6b6cbbc73b6d1cb3b1;hp=211fcd63cffc664b226133be8dcce5b6b77ac081;hpb=a15243f15da7ef43b21dd24d77787c41d942ce75;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index 211fcd63cf..009b18a13e 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -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' );