Skip to content

Commit

Permalink
fix(selectfield): trim values
Browse files Browse the repository at this point in the history
if a value is not trimmed in DB, the validation process fails
  • Loading branch information
btry committed Jun 2, 2022
1 parent ec029e3 commit 4f59294
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions inc/abstractfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4f59294

Please sign in to comment.