Skip to content

Commit

Permalink
#9306 Escape context names in form field labels
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Sep 15, 2023
1 parent 8b26ee4 commit d4111c4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct($action, $context, $userGroups) {
while ($userGroup = $userGroups->next()) {
$userGroupOptions[] = [
'value' => $userGroup->getId(),
'label' => $userGroup->getLocalizedData('name'),
'label' => htmlspecialchars($userGroup->getLocalizedData('name')),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct($action, $site, $contexts) {
foreach ($contexts as $context) {
$options[] = [
'value' => $context->id,
'label' => $context->name,
'label' => htmlspecialchars($context->name),
];
}

Expand Down
2 changes: 1 addition & 1 deletion classes/components/forms/site/PKPSiteConfigForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct($action, $locales, $site) {
foreach ($contextsIterator as $context) {
$options[] = [
'value' => $context->getId(),
'label' => $context->getLocalizedData('name'),
'label' => htmlspecialchars($context->getLocalizedData('name')),
];
}
if (count($options) > 1) $this->addField(new FieldSelect('redirect', [
Expand Down

0 comments on commit d4111c4

Please sign in to comment.