, , etc.
+ wfRunHooks( 'ParserBeforeStrip', array( &$this, &$text, &$this->mStripState ) );
+ $text = $this->strip( $text, $this->mStripState );
+ wfRunHooks( 'ParserAfterStrip', array( &$this, &$text, &$this->mStripState ) );
+ if ( $this->ot['html'] ) {
+ $text = Sanitizer::removeHTMLtags( $text, array( &$this, 'attributeStripCallback' ), $args );
+ } elseif ( $this->ot['pre'] && $this->mOptions->getRemoveComments() ) {
+ $text = Sanitizer::removeHTMLcomments( $text );
+ }
+ }
+
+ # Prevent too big inclusions
+ if( strlen( $text ) > $this->mOptions->getMaxIncludeSize() ) {
+ array_pop( $this->mArgStack );
+ return $text;
+ }
$braceCallbacks = array();
if ( !$argsOnly ) {
@@ -3142,15 +3157,6 @@
$text = StringUtils::delimiterReplace( '', '', '', $text );
$text = strtr( $text, array( '' => '' , '' => '' ) );
- if( $this->ot['html'] || $this->ot['pre'] ) {
- # Strip , , etc.
- $text = $this->strip( $text, $this->mStripState );
- if ( $this->ot['html'] ) {
- $text = Sanitizer::removeHTMLtags( $text, array( &$this, 'replaceVariables' ), $assocArgs );
- } elseif ( $this->ot['pre'] && $this->mOptions->getRemoveComments() ) {
- $text = Sanitizer::removeHTMLcomments( $text );
- }
- }
$text = $this->replaceVariables( $text, $assocArgs );
# If the template begins with a table or block-level