Skip to content

Commit 4f59294

Browse files
committed
fix(selectfield): trim values
if a value is not trimmed in DB, the validation process fails
1 parent ec029e3 commit 4f59294

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

inc/abstractfield.class.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@ public function getAvailableValues() {
158158
$values = json_decode($this->question->fields['values']);
159159
$tab_values = [];
160160
foreach ($values as $value) {
161-
if ((trim($value) != '')) {
162-
$tab_values[$value] = $value;
161+
$trimmedValue = trim($value);
162+
if (($trimmedValue != '')) {
163+
$tab_values[$trimmedValue] = $trimmedValue;
163164
}
164165
}
165166
return $tab_values;

0 commit comments

Comments
 (0)