mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-24 00:58:49 +00:00
Merge branch '1.x' into 2.x
* 1.x: Replace strtolower() with strtr() when dealing with method names
This commit is contained in:
@@ -643,7 +643,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