1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

[ticket/11943] Throw an exception if DEFINE is setup improperly

PHPBB3-11943
This commit is contained in:
Nathan Guse
2013-11-09 11:14:55 -06:00
parent 6370970f13
commit 2e5117a71e
2 changed files with 15 additions and 0 deletions

View File

@@ -30,6 +30,13 @@ class defineparser extends \Twig_TokenParser
$stream->next();
$value = $this->parser->getExpressionParser()->parseExpression();
if ($value instanceof \Twig_Node_Expression_Name)
{
// This would happen if someone improperly formed their DEFINE syntax
// e.g. <!-- DEFINE $VAR = foo -->
throw new \Twig_Error_Syntax('Invalid DEFINE', $token->getLine(), $this->parser->getFilename());
}
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
} else {
$capture = true;