This commit is contained in:
2025-02-03 10:20:20 +01:00
parent cbbf09677e
commit f39c328d06
6 changed files with 116 additions and 16 deletions

View File

@ -4,21 +4,14 @@ include_once 'config.php';
$lan = filter_input(INPUT_GET, 'lan', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '/^[\da-zA-Z-. \/]+$/'], "flags" => FILTER_NULL_ON_FAILURE]);
if ($lan) {
$cmd = $lanScanCmd;
$targets = $lan;
$stylesheet = $lanScanStylesheet;
}
$cmd = "$lanScanCmd $lan";
if ($cmd) {
if (!file_exists($SCANSDIR)) mkdir($SCANSDIR);
$path = "$SCANSDIR/".str_replace("/", "!", $targets).".xml";
$filname = str_replace("/", "!", $lan);
$path = "$SCANSDIR/$filname.xml";
if (file_exists($path)) {
$cmd .= "?original=".rawurlencode($targets);
$cmd .= " $targets";
} else {
$cmd .= " $targets";
$command .= " | tee '$path'";
if (!file_exists($path)) {
$cmd .= " | tee '$path'";
}
header('Content-type: text/xml');