Closed
Description
Using Symfony\Component\ExpressionLanguage::tokenize() with ' '
(only spaces) or any expression with trailing spaces like '1 + 1 '
will produce an Uninitialized string offset: X
php warning due to the way spaces are ignored:
// Symfony\Component\ExpressionLanguage::tokenize() lines 39 to 41
while (' ' == $expression[$cursor]) {
++$cursor;
}
If EOF_TYPE
Token position is not a problem, a rtrim
on passed expression will do the job.