Add nonce

This commit is contained in:
Skylar Ittner 2020-04-07 15:15:30 -06:00
parent d418681d49
commit dd4a18c6ff

View File

@ -23,9 +23,9 @@ require_once __DIR__ . "/../lib/required_public.php";
// Allow setting the page background to match the style of a parent frame // Allow setting the page background to match the style of a parent frame
if (isset($_GET["backgroundcolor"]) && !empty($_GET["backgroundcolor"]) && preg_match("/^[a-z0-9#\-]+$/i", $_GET["backgroundcolor"])) { if (isset($_GET["backgroundcolor"]) && !empty($_GET["backgroundcolor"]) && preg_match("/^[a-z0-9#\-]+$/i", $_GET["backgroundcolor"])) {
?> ?>
<style> <style nonce="<?php echo $SECURE_NONCE; ?>">
html,body { html,body {
background-color: <?php echo $_GET["backgroundcolor"]; ?> background-color: <?php echo $_GET["backgroundcolor"]; ?>;
} }
</style> </style>
<?php <?php