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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user