Skip to content

Commit

Permalink
Decode entities in checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
takayukister committed Mar 9, 2024
1 parent b721f43 commit 1f7f591
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions modules/checkbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,21 @@ function ( $values, $tag ) {
continue;
}

$field_values = array_map(
static function ( $value ) {
return html_entity_decode(
(string) $value,
ENT_QUOTES | ENT_HTML5,
'UTF-8'
);
},
$field_values
);

$field_values = array_filter(
array_unique( $field_values ),
function ( $value ) {
return is_string( $value ) && '' !== $value;
static function ( $value ) {
return '' !== $value;
}
);

Expand Down

0 comments on commit 1f7f591

Please sign in to comment.