Skip to content

Commit 83e91ef

Browse files
bug symfony#61856 [Console] do not pass the empty string to ord() (xabbuh)
This PR was merged into the 6.4 branch. Discussion ---------- [Console] do not pass the empty string to ord() | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT see php/php-src#19440 and https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_string_which_are_not_one_byte_long_to_ord Commits ------- 30037a1 do not pass the empty string to ord()
2 parents a23e85e + 30037a1 commit 83e91ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Console/Helper/QuestionHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu
317317
$ofs += ('A' === $c[2]) ? -1 : 1;
318318
$ofs = ($numMatches + $ofs) % $numMatches;
319319
}
320-
} elseif (\ord($c) < 32) {
320+
} elseif ('' === $c || \ord($c) < 32) {
321321
if ("\t" === $c || "\n" === $c) {
322322
if ($numMatches > 0 && -1 !== $ofs) {
323323
$ret = (string) $matches[$ofs];

0 commit comments

Comments
 (0)