N°7514 - hardening code

This commit is contained in:
Eric Espie
2024-06-18 16:00:08 +02:00
parent 9514977ce2
commit 6e364a0ab9
2 changed files with 3 additions and 1 deletions

View File

@@ -53,7 +53,8 @@ class MultipleChoicesValidator extends AbstractValidator
private function CheckValueAgainstChoices(string $sValue, array &$aErrorMessages): void
{
if (false === array_key_exists($sValue, $this->aChoices)) {
$aErrorMessages[] = "Value ({$sValue}) is not part of the field possible values list";
$sValue = utils::HtmlEntities($sValue);
$aErrorMessages[] = "Value ({$sValue}) is not part of the field possible values list";
}
}
}

View File

@@ -37,6 +37,7 @@ class SelectObjectValidator extends AbstractValidator
$iObjectsCount = $oSetForExistingCurrentValue->CountWithLimit(1);
if ($iObjectsCount === 0) {
$value = utils::HtmlEntities($value);
return ["Value $value does not match the corresponding filter set"];
}