From 8e5f010da010f586c141079dcea3cf64884f3636 Mon Sep 17 00:00:00 2001 From: adrien Date: Wed, 23 Oct 2024 15:17:03 +0200 Subject: [PATCH] rename saveAs to name --- filter_inputs.php | 2 +- index.php | 6 +++--- scan.php | 6 +++--- templates/hostScan.xsl | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/filter_inputs.php b/filter_inputs.php index 549f48c..4003dfa 100644 --- a/filter_inputs.php +++ b/filter_inputs.php @@ -109,7 +109,7 @@ if ($preset && isset($presets[$preset])) { '-h' => FILTER_VALIDATE_BOOLEAN, '--stylesheet' => FILTER_VALIDATE_URL, // lanScan - 'saveAs' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]], + 'name' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]], 'originalURL' => FILTER_VALIDATE_URL, 'refreshPeriod' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]], 'sudo' => FILTER_VALIDATE_BOOLEAN, diff --git a/index.php b/index.php index 00cc5b5..0c62aef 100755 --- a/index.php +++ b/index.php @@ -632,10 +632,10 @@ foreach (scandir($SCANSDIR) as $filename) {
- - Enregistrer sous le nom + "> + value="">
diff --git a/scan.php b/scan.php index 7b70654..93d383b 100755 --- a/scan.php +++ b/scan.php @@ -41,7 +41,7 @@ $xml = new DOMDocument(); $xml->load($tempPath); `rm "$tempPath"`; -$thisURL = $options["saveAs"]?? false ? "$BASEDIR/$SCANSDIR/".rawurlencode($options["saveAs"]).".xml" : ""; +$thisURL = $options["name"]?? false ? "$BASEDIR/$SCANSDIR/".rawurlencode($options["name"]).".xml" : ""; $xml->insertBefore($xml->createProcessingInstruction('xslt-param', "name='thisURL' value='".htmlentities($thisURL, ENT_QUOTES)."'"), $xml->documentElement); foreach ($options as $option => $value) { if (substr($option, 0, 1) != '-') { @@ -49,8 +49,8 @@ foreach ($options as $option => $value) { } } -if ($options["saveAs"] ?? false) { - $path = "$SCANSDIR/{$options["saveAs"]}.xml"; +if ($options["name"] ?? false) { + $path = "$SCANSDIR/{$options["name"]}.xml"; $xml->save($path); header("Location: $path"); diff --git a/templates/hostScan.xsl b/templates/hostScan.xsl index aa2f094..24c0f5d 100755 --- a/templates/hostScan.xsl +++ b/templates/hostScan.xsl @@ -24,7 +24,7 @@ - +