Skip to content

Commit 9ed6b63

Browse files
Merge branch '7.4' into 8.0
* 7.4: [DependencyInjection][Routing] Fix nested config imports when returning PHP arrays fix compatibility with Relay 0.12.1 [TypeInfo] Fix resolving use statements with line breaks [FrameworkBundle] Fix normalization of enums in workflow transitions Add missing return type for docblock Closure don't use a fixed date fixture when assertions depend on relative times [FrameworkBundle] Fix secrets:encrypt-from-local [Security] Add support for `Sec-Fetch-Site` to `SameOriginCsrfTokenManager` [Console] Optimize mostRecentlyEnteredValue() method [HttpClient] Add QUERY to the list of retriable HTTP methods Update regular expression in URL validator [AssetMapper] Fix parsing @import that don't use url() [Messenger] Add retry delay on amazon sqs [Serializer] CsvEncoder to escape values starting with line feed when escape formulas is enabled
2 parents 01bfc76 + c3da862 commit 9ed6b63

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Helper/QuestionHelper.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,13 @@ private function mostRecentlyEnteredValue(string $entered): string
379379
return $entered;
380380
}
381381

382-
$choices = explode(',', $entered);
383-
if ('' !== $lastChoice = trim($choices[\count($choices) - 1])) {
384-
return $lastChoice;
382+
if (false === $lastCommaPos = strrpos($entered, ',')) {
383+
return $entered;
385384
}
386385

387-
return $entered;
386+
$lastChoice = trim(substr($entered, $lastCommaPos + 1));
387+
388+
return '' !== $lastChoice ? $lastChoice : $entered;
388389
}
389390

390391
/**

0 commit comments

Comments
 (0)