Skip to content

Commit

Permalink
fix: lettura valori select
Browse files Browse the repository at this point in the history
  • Loading branch information
Pek5892 committed Oct 22, 2024
1 parent b16f3d0 commit 4472a99
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/HTMLBuilder/Handler/SelectHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ protected function select2($op, $elements, $info, $link = null)

// Leggo ulteriori campi oltre a id e descrizione per inserirli nell'option nella forma "data-nomecampo1", "data-nomecampo2", ecc
unset($element['optgroup']);
$attributes[] = "data-select-attributes='".replace(json_encode($element), ["'" => "\'"])."'";

$attributes[] = "data-select-attributes='".htmlspecialchars(json_encode($element), ENT_QUOTES)."'";
$html .= '
<option value="'.prepareToField($element['id']).'" '.implode(' ', $attributes).(!empty($element['disabled']) ? 'disabled' : '').'>'.$element['text'].'</option>';
}
Expand Down Expand Up @@ -226,8 +225,7 @@ protected function selectArray($array, $values, $link = null)

// Leggo ulteriori campi oltre a id e descrizione per inserirli nell'option nella forma "data-nomecampo1", "data-nomecampo2", ecc
unset($element['optgroup']);
$attributes[] = "data-select-attributes='".replace(json_encode($element), ["'" => "\'"])."'";

$attributes[] = "data-select-attributes='".htmlspecialchars(json_encode($element), ENT_QUOTES)."'";
$result .= '
<option value="'.prepareToField($element['id']).'" '.implode(' ', $attributes).'>'.$element['text'].'</option>';
}
Expand Down

0 comments on commit 4472a99

Please sign in to comment.