Fix yet more image links bugs
[lhc/web/wiklou.git] / includes / ParserOptions.php
index 7be42ab..330ec44 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * Set options of the Parser
  * @todo document
- * @addtogroup Parser
+ * @ingroup Parser
  */
 class ParserOptions
 {
@@ -23,6 +23,7 @@ class ParserOptions
        var $mTargetLanguage;            # Overrides above setting with arbitrary language
        var $mMaxIncludeSize;            # Maximum size of template expansions, in bytes
        var $mMaxPPNodeCount;            # Maximum number of nodes touched by PPFrame::expand()
+       var $mMaxPPExpandDepth;          # Maximum recursion depth in PPFrame::expand()
        var $mMaxTemplateDepth;          # Maximum recursion depth for templates within templates
        var $mRemoveComments;            # Remove HTML comments. ONLY APPLIES TO PREPROCESS OPERATIONS
        var $mTemplateCallback;          # Callback for template fetching
@@ -63,11 +64,11 @@ class ParserOptions
                return $this->mDateFormat;
        }
 
-       function getTimestamp() { 
+       function getTimestamp() {
                if ( !isset( $this->mTimestamp ) ) {
                        $this->mTimestamp = wfTimestampNow();
                }
-               return $this->mTimestamp; 
+               return $this->mTimestamp;
        }
 
        function setUseTeX( $x )                    { return wfSetVar( $this->mUseTeX, $x ); }
@@ -107,7 +108,7 @@ class ParserOptions
        function initialiseFromUser( $userInput ) {
                global $wgUseTeX, $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages;
                global $wgAllowExternalImagesFrom, $wgAllowSpecialInclusion, $wgMaxArticleSize;
-               global $wgMaxPPNodeCount, $wgMaxTemplateDepth;
+               global $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth;
                $fname = 'ParserOptions::initialiseFromUser';
                wfProfileIn( $fname );
                if ( !$userInput ) {
@@ -138,6 +139,7 @@ class ParserOptions
                $this->mTargetLanguage = null; // default depends on InterfaceMessage setting
                $this->mMaxIncludeSize = $wgMaxArticleSize * 1024;
                $this->mMaxPPNodeCount = $wgMaxPPNodeCount;
+               $this->mMaxPPExpandDepth = $wgMaxPPExpandDepth;
                $this->mMaxTemplateDepth = $wgMaxTemplateDepth;
                $this->mRemoveComments = true;
                $this->mTemplateCallback = array( 'Parser', 'statelessFetchTemplate' );
@@ -145,5 +147,3 @@ class ParserOptions
                wfProfileOut( $fname );
        }
 }
-
-