more FILTER_SANITIZE_STRING fixes

This commit is contained in:
Andy Miller 2023-05-09 12:13:32 -06:00
parent 956c2993ae
commit 66463ddff3
No known key found for this signature in database
GPG Key ID: 9F2CF38AEBDB0AE0

View File

@ -366,9 +366,14 @@ trait PageLegacyTrait
*/
public function blueprintName(): string
{
$blueprint_name = filter_input(INPUT_POST, 'blueprint', FILTER_SANITIZE_STRING) ?: $this->template();
if (!isset($_POST['blueprint'])) {
return $this->template();
}
return $blueprint_name;
$post_value = $_POST['blueprint'];
$sanitized_value = htmlspecialchars(strip_tags($post_value), ENT_QUOTES, 'UTF-8');
return $sanitized_value ?: $this->template();
}
/**