fix scan args
This commit is contained in:
13
scan.php
13
scan.php
@ -12,18 +12,19 @@ if (!file_exists($SCANS_DIR)) {
|
||||
mkdir($SCANS_DIR);
|
||||
}
|
||||
|
||||
$basedir = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}".dirname($_SERVER['REQUEST_URI']);
|
||||
$basedir = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}" . dirname($_SERVER['REQUEST_URI']);
|
||||
|
||||
$args = '';
|
||||
foreach ($options as $arg => $value) {
|
||||
foreach ($inputs as $name => $value) {
|
||||
echo "$name : $value $args<br>";
|
||||
if (is_null($value)) {
|
||||
http_response_code(400);
|
||||
exit("Valeur incorecte pour le paramètre $option : ".filter_input(INPUT_GET, $option, FILTER_SANITIZE_FULL_SPECIAL_CHARS));
|
||||
exit("Valeur incorecte pour le paramètre $option : " . filter_input(INPUT_GET, $option, FILTER_SANITIZE_FULL_SPECIAL_CHARS));
|
||||
} else if ($value) {
|
||||
if ($value === true) {
|
||||
$args .= " -$arg";
|
||||
$args .= " -$name";
|
||||
} else {
|
||||
$arg .= " -$arg ".escapeshellarg($value);
|
||||
$args .= " -$name " . ($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -42,7 +43,7 @@ if (!file_exists($SCANS_DIR)) {
|
||||
mkdir($SCANS_DIR);
|
||||
}
|
||||
|
||||
$path = "$SCANS_DIR/".str_replace('/', '!', $targets).'.xml';
|
||||
$path = "$SCANS_DIR/" . str_replace('/', '!', $targets) . '.xml';
|
||||
if (!file_exists($path)) {
|
||||
$xml->insertBefore($xml->createProcessingInstruction('xslt-param', "name='compareWith' value=''"), $xml->documentElement);
|
||||
$xml->save($path);
|
||||
|
Reference in New Issue
Block a user