Skip to content

Commit 8aaec8a

Browse files
committed
fix(selectfield,multiselectfield): fix possible encoding problem
1 parent e9badc4 commit 8aaec8a

6 files changed

+446
-4
lines changed

inc/field/multiselectfield.class.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
use Dropdown;
3636
use Html;
37+
use Glpi\Toolbox\Sanitizer;
3738

3839
class MultiSelectField extends CheckboxesField
3940
{
@@ -55,8 +56,10 @@ public function getRenderedHtml($domain, $canEdit = true): string {
5556
$fieldName = 'formcreator_field_' . $id;
5657
$values = $this->getAvailableValues();
5758
$translatedValues = [];
59+
5860
foreach ($values as $key => $value) {
59-
$translatedValues[$key] = __($value, $domain);
61+
$unsanitized = Sanitizer::unsanitize(__($value, $domain));
62+
$translatedValues[$key] = $unsanitized;
6063
}
6164
if (!empty($values)) {
6265
$html .= Dropdown::showFromArray($fieldName, $translatedValues, [

inc/formanswer.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ protected function validateFormAnswer($input): bool {
14231423
);
14241424
}
14251425

1426-
$this->isAnswersValid = false;
1426+
$this->isAnswersValid = false;
14271427
}
14281428
}
14291429
}

install/install.php

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class PluginFormcreatorInstall {
8282
'2.13.3' => '2.13.4',
8383
'2.13.4' => '2.13.5',
8484
'2.13.5' => '2.13.6',
85+
'2.13.6' => '2.13.7',
8586
];
8687

8788
protected bool $resyncIssues = false;

0 commit comments

Comments
 (0)