Skip to content

Commit

Permalink
fix(options): escape select option label
Browse files Browse the repository at this point in the history
HTML only supports text content there, so any HTML leads to broken results.
  • Loading branch information
MHajoha committed Dec 19, 2024
1 parent c03786f commit dc39584
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/form/elements/select_element.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function render_to(render_context $context): void {
$selected = [];
$optionsassociative = [];
foreach ($this->options as $option) {
$optionsassociative[$option->value] = $context->contextualize($option->label);
$optionsassociative[$option->value] = s($context->contextualize($option->label));
if ($option->selected) {
$selected[] = $option->value;
}
Expand Down

0 comments on commit dc39584

Please sign in to comment.