diff --git a/inc/abstractfield.class.php b/inc/abstractfield.class.php index bd39bfb94..b91edce22 100644 --- a/inc/abstractfield.class.php +++ b/inc/abstractfield.class.php @@ -158,8 +158,9 @@ public function getAvailableValues() { $values = json_decode($this->question->fields['values']); $tab_values = []; foreach ($values as $value) { - if ((trim($value) != '')) { - $tab_values[$value] = $value; + $trimmedValue = trim($value); + if (($trimmedValue != '')) { + $tab_values[$trimmedValue] = $trimmedValue; } } return $tab_values;