Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2d31a0a

Browse filesBrowse files
committed
bug #9621 [ExpressionLanguage] fixed lexing expression ending with spaces (fabpot)
This PR was submitted for the master branch but it was merged into the 2.4 branch instead (closes #9621). Discussion ---------- [ExpressionLanguage] fixed lexing expression ending with spaces | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #9606, #9615 | License | MIT | Doc PR | Alternative fix for #9615 Commits ------- d8f61c4 [ExpressionLanguage] fixed lexing expression ending with spaces
2 parents 8a780a9 + 4c0b44e commit 2d31a0a
Copy full SHA for 2d31a0a

File tree

Expand file treeCollapse file tree

2 files changed

+7
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-1
lines changed

‎src/Symfony/Component/ExpressionLanguage/Lexer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/ExpressionLanguage/Lexer.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ public function tokenize($expression)
3636
$end = strlen($expression);
3737

3838
while ($cursor < $end) {
39-
while (' ' == $expression[$cursor]) {
39+
if (' ' == $expression[$cursor]) {
4040
++$cursor;
41+
42+
continue;
4143
}
4244

4345
if (preg_match('/[0-9]+(?:\.[0-9]+)?/A', $expression, $match, null, $cursor)) {

‎src/Symfony/Component/ExpressionLanguage/Tests/LexerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/ExpressionLanguage/Tests/LexerTest.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ public function testTokenize($tokens, $expression)
3030
public function getTokenizeData()
3131
{
3232
return array(
33+
array(
34+
array(new Token('name', 'a', 3)),
35+
' a ',
36+
),
3337
array(
3438
array(new Token('name', 'a', 1)),
3539
'a',

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.