Merge branch '3.4' into 4.2

* 3.4:
  refactored code
This commit is contained in:
Fabien Potencier 2019-05-08 22:08:34 +02:00
commit 3fc97ce1c5

View File

@ -328,19 +328,17 @@ class QuestionHelper extends Helper
private function mostRecentlyEnteredValue($entered) private function mostRecentlyEnteredValue($entered)
{ {
$tempEntered = $entered;
// Determine the most recent value that the user entered // Determine the most recent value that the user entered
if (false !== strpos($entered, ',')) { if (false === strpos($entered, ',')) {
$choices = explode(',', $entered); return $entered;
$lastChoice = trim($choices[\count($choices) - 1]);
if (\strlen($lastChoice) > 0) {
$tempEntered = $lastChoice;
}
} }
return $tempEntered; $choices = explode(',', $entered);
if (\strlen($lastChoice = trim($choices[\count($choices) - 1])) > 0) {
return $lastChoice;
}
return $entered;
} }
/** /**