Skip to content

Commit

Permalink
Add escaping to field labels
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Sep 15, 2023
1 parent 909d50f commit 43e3855
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function __construct($action, $locales, $announcementContext)
foreach ($announcementTypes as $announcementType) {
$announcementOptions[] = [
'value' => (int) $announcementType->getId(),
'label' => $announcementType->getLocalizedTypeName(),
'label' => htmlspecialchars($announcementType->getLocalizedTypeName()),
];
}
if (!empty($announcementOptions)) {
Expand Down
4 changes: 2 additions & 2 deletions classes/components/forms/context/PKPAppearanceSetupForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct($action, $locales, $context, $baseUrl, $temporaryFil
if (isset($plugins[$plugin])) {
$enabledOptions[] = [
'value' => $plugin,
'label' => $plugins[$plugin]->getDisplayName(),
'label' => htmlspecialchars($plugins[$plugin]->getDisplayName()),
];
}
}
Expand All @@ -67,7 +67,7 @@ public function __construct($action, $locales, $context, $baseUrl, $temporaryFil
if (!in_array($pluginName, $currentBlocks)) {
$disabledOptions[] = [
'value' => $pluginName,
'label' => $plugin->getDisplayName(),
'label' => htmlspecialchars($plugin->getDisplayName()),
];
}
}
Expand Down
4 changes: 2 additions & 2 deletions classes/components/forms/context/PKPPaymentSettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct($action, $locales, $context)
foreach (Locale::getCurrencies() as $currency) {
$currencies[] = [
'value' => $currency->getLetterCode(),
'label' => $currency->getLocalName(),
'label' => htmlspecialchars($currency->getLocalName()),
];
}

Expand All @@ -57,7 +57,7 @@ public function __construct($action, $locales, $context)
foreach ($paymentPlugins as $plugin) {
$pluginList[] = [
'value' => $plugin->getName(),
'label' => $plugin->getDisplayName(),
'label' => htmlspecialchars($plugin->getDisplayName()),
];
}

Expand Down
2 changes: 1 addition & 1 deletion classes/components/forms/context/PKPThemeForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function __construct($action, $locales, $context = null)
foreach ($plugins as $plugin) {
$themes[] = [
'value' => $plugin->getDirName(),
'label' => $plugin->getDisplayName(),
'label' => htmlspecialchars($plugin->getDisplayName()),
];
}

Expand Down
2 changes: 1 addition & 1 deletion classes/components/forms/site/PKPSiteAppearanceForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct($action, $locales, $site, $baseUrl, $temporaryFileAp
foreach ($plugins as $pluginName => $plugin) {
$sidebarOptions[] = [
'value' => $pluginName,
'label' => $plugin->getDisplayName(),
'label' => htmlspecialchars($plugin->getDisplayName()),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct($action, $genres)
'options' => array_map(function ($genre) {
return [
'value' => (int) $genre->getId(),
'label' => $genre->getLocalizedName(),
'label' => htmlspecialchars($genre->getLocalizedName()),
];
}, $genres),
'value' => 0,
Expand Down

0 comments on commit 43e3855

Please sign in to comment.