This commit is contained in:
Adrien MALINGREY 2024-10-07 20:34:38 +02:00
parent 0d56163339
commit b02c89973c

View File

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