From: Brad Jorsch
Date: Mon, 31 Oct 2016 20:37:26 +0000 (-0400)
Subject: Don't parse
X-Git-Tag: 1.31.0-rc.0~4984^2
X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=b33a5c013e31dee5717da50dc670e19eabd1c73c;p=lhc%2Fweb%2Fwiklou.git
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
---
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