filter input

This commit is contained in:
Adrien MALINGREY 2024-10-07 20:33:03 +02:00
parent 6319d411c5
commit 0d56163339

10
rdp.php
View File

@ -1,6 +1,10 @@
<?php
header('Content-Disposition: attachment; filename='.str_replace(':', '_', $_GET['v']).'.rdp');
header('Content-Type: application/rdp');
echo "full address:s:${_GET['v']}\n";
$host = filter_input(INPUT_GET, 'v', FILTER_VALIDATE_DOMAIN) ?: filter_input(INPUT_GET, 'v', FILTER_VALIDATE_IP);
if (!$host) {
exit();
}
header('Content-Disposition: attachment; filename='.str_replace(':', '_', $host).'.rdp');
header('Content-Type: application/rdp');
echo "full address:s:$host\n";