mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-23 16:48:28 +00:00
Merge branch '2.x' into 3.x
* 2.x: Replace strtolower() with strtr() when dealing with method names
This commit is contained in:
@@ -638,7 +638,7 @@ class ExpressionParser
|
||||
$stream->expect(/* Token::NAME_TYPE */ 5, null, 'Only variables can be assigned to');
|
||||
}
|
||||
$value = $token->getValue();
|
||||
if (\in_array(strtolower($value), ['true', 'false', 'none', 'null'])) {
|
||||
if (\in_array(strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), ['true', 'false', 'none', 'null'])) {
|
||||
throw new SyntaxError(sprintf('You cannot assign a value to "%s".', $value), $token->getLine(), $stream->getSourceContext());
|
||||
}
|
||||
$targets[] = new AssignNameExpression($value, $token->getLine());
|
||||
|
||||
Reference in New Issue
Block a user