From b33a5c013e31dee5717da50dc670e19eabd1c73c Mon Sep 17 00:00:00 2001
From: Brad Jorsch
Date: Mon, 31 Oct 2016 16:37:26 -0400
Subject: [PATCH] Don't parse
Which means we can't check if a parser limit was exceeded while trying
to expand the content of a tag, but that's probably not a huge loss.
It'll just result in potentially strange output rather than an exception.
Bug: T149622
Change-Id: I7910dfa0f61b1cc9168c7ed1498b2bda27c47f0e
---
includes/parser/Parser.php | 7 +++----
tests/parser/parserTests.txt | 9 +++++++++
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 669e9fc126..27c95358a0 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -3801,11 +3801,10 @@ class Parser {
return $attrText;
}
+ // We can't safely check if the expansion for $content resulted in an
+ // error, because the content could happen to be the error string
+ // (T149622).
$content = !isset( $params['inner'] ) ? null : $frame->expand( $params['inner'] );
- if ( substr( $content, 0, $errorLen ) === $errorStr ) {
- // See above
- return $content;
- }
$marker = self::MARKER_PREFIX . "-$name-"
. sprintf( '%08X', $this->mMarkerIndex++ ) . self::MARKER_SUFFIX;
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index ba7b0d462a..103acc609e 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -1420,6 +1420,15 @@ sed abit.
!! end
+!! test
+Don't parse (T149622)
+!! wikitext
+
+!! html/php
+<span class="error">
+
+!! end
+
!! test
nowiki 3
!! wikitext
--
2.20.1