jilo-web/app/helpers/sanitize.php

52 lines
1.2 KiB
PHP
Raw Normal View History

2024-10-04 08:36:45 +00:00
<?php
2024-10-04 11:18:28 +00:00
// sanitize all input vars that may end up in URLs or forms
2024-10-04 08:36:45 +00:00
$platform_id = htmlspecialchars($_REQUEST['platform']);
if (isset($_REQUEST['page'])) {
$page = htmlspecialchars($_REQUEST['page']);
} else {
$page = 'dashboard';
}
if (isset($_REQUEST['item'])) {
$item = htmlspecialchars($_REQUEST['item']);
} else {
$item = '';
}
2024-10-04 11:18:28 +00:00
if (isset($_REQUEST['from_time'])) {
$from_time = htmlspecialchars($_REQUEST['from_time']);
}
if (isset($_REQUEST['until_time'])) {
$until_time = htmlspecialchars($_REQUEST['until_time']);
}
2024-10-04 08:36:45 +00:00
if (isset($_SESSION['notice'])) {
$notice = htmlspecialchars($_SESSION['notice']); // 'notice' for all non-critical messages
}
if (isset($_SESSION['error'])) {
$error = htmlspecialchars($_SESSION['error']); // 'error' for errors
}
2024-10-04 11:18:28 +00:00
// agents
if (isset($_POST['type'])) {
$type = htmlspecialchars($_POST['type']);
2024-10-04 08:36:45 +00:00
}
2024-10-04 11:18:28 +00:00
if (isset($_POST['url'])) {
$url = htmlspecialchars($_POST['url']);
}
if (isset($_POST['secret_key'])) {
$secret_key = htmlspecialchars($_POST['secret_key']);
}
2024-10-24 09:11:35 +00:00
if (isset($_POST['check_period'])) {
$check_period = htmlspecialchars($_POST['check_period']);
}
2024-10-04 11:18:28 +00:00
// platforms
if (isset($_POST['name'])) {
$name = htmlspecialchars($_POST['name']);
2024-10-04 08:36:45 +00:00
}
?>