8000 minor #22325 [ExpressionLanguage] Avoid ExpressionLanguage dependency… · maidmaid/symfony@0eed690 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0eed690

Browse files
committed
minor symfony#22325 [ExpressionLanguage] Avoid ExpressionLanguage dependency on ctype (nijel)
This PR was submitted for the 3.2 branch but it was merged into the 2.7 branch instead (closes symfony#22325). Discussion ---------- [ExpressionLanguage] Avoid ExpressionLanguage dependency on ctype | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none | License | MIT | Doc PR | none There is undocumented dependency on ctype extension in ExpressionLanguage. I've chosen to remove it rather than document as we're using ExpressionLanguage in phpMyAdmin and this is only dependency which needs ctype. I'm submitting this against 3.2 to get this fix to released version sooner, but it can be without problems applied to master as well. Commits ------- 81de5fe [ExpressionLanguage] Avoid dependency on ctype
2 parents d48fae7 + 81de5fe commit 0eed690

File tree

1 file changed

+1
-1
lines changed
  • src/Symfony/Component/ExpressionLanguage

1 file changed

+1
-1
lines changed

src/Symfony/Component/ExpressionLanguage/Lexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function tokenize($expression)
4545
if (preg_match('/[0-9]+(?:\.[0-9]+)?/A', $expression, $match, null, $cursor)) {
4646
// numbers
4747
$number = (float) $match[0]; // floats
48-
if (ctype_digit($match[0]) && $number <= PHP_INT_MAX) {
48+
if (preg_match('/^[0-9]+$/', $match[0]) && $number <= PHP_INT_MAX) {
4949
$number = (int) $match[0]; // integers lower than the maximum
5050
}
5151
$tokens[] = new Token(Token::NUMBER_TYPE, $number, $cursor + 1);

0 commit comments

Comments
 (0)
0