jilo-web/app/helpers/sanitize.php

49 lines
1.1 KiB
PHP
Raw Permalink 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']);
}
// platforms
if (isset($_POST['name'])) {
$name = htmlspecialchars($_POST['name']);
2024-10-04 08:36:45 +00:00
}
?>