Skip to content

Commit 353cf55

Browse files
b4nmasatake
authored andcommitted
html: Avoid infinite ping-pong loop with JSP tags
Fix #4097 JSP tags shouldn't trigger the PHP parser. This used to happen and trigger an infinite loop of a ping-pong effect with the HTML parser asking the PHP parser to parse the JSP block, and the PHP parser, not recognizing the input, asking the HTML one to deal with it. Rinse and repeat.
1 parent 0115717 commit 353cf55

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

Units/parser-html.r/jsp.d/README

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
JSP tags shouldn't trigger the PHP parser.
2+
3+
This used to happen and trigger an infinite loop of a ping-pong effect
4+
with the HTML parser asking the PHP parser to parse the JSP block, and
5+
the PHP parser, not recognizing the input, asking the HTML one to deal
6+
with it. Rinse and repeat.

Units/parser-html.r/jsp.d/args.ctags

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--sort=no
2+
--extras='*'

Units/parser-html.r/jsp.d/input.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%=

parsers/html.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ static void readToken (tokenInfo *const token, bool skipComments, bool asJSX)
356356
ungetcToInputFile (d);
357357
token->type = TOKEN_OTHER;
358358
}
359-
else if (d == '?' || d == '%')
359+
else if (d == '?')
360360
{
361361
skipOtherScriptContent(d);
362362
goto getNextChar;

0 commit comments

Comments
 (0)