From 89a7613f9ed15eeb20eff72c6753f801285c587c Mon Sep 17 00:00:00 2001 From: adrien Date: Mon, 14 Oct 2024 05:00:51 +0200 Subject: [PATCH] encode url --- options.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/options.php b/options.php index eb34e93..51f77c9 100755 --- a/options.php +++ b/options.php @@ -214,7 +214,7 @@ Exemples: /24 10. foreach (scandir('.') as $filename) { if (substr($filename, -4) === '.xsl') { $name = substr($filename, 0, -4); - $URL = "$BASEDIR/$filename"; + $URL = htmlentities("$BASEDIR/$filename", ENT_QUOTES); if (isset($inputs["stylesheet"]) && $URL == $inputs["stylesheet"]) { echo " \n"; } else { @@ -235,7 +235,7 @@ if (!file_exists($SCANSDIR)) mkdir($SCANSDIR); foreach (scandir($SCANSDIR) as $filename) { if (substr($filename, -4) === '.xml') { $name = substr($filename, 0, -4); - $URL = "$BASEDIR/$SCANSDIR/$filename"; + $URL = htmlentities("$BASEDIR/$SCANSDIR/$filename", ENT_QUOTES); if ($URL == $compareWith) { echo " \n"; } else { @@ -269,17 +269,17 @@ foreach (scandir($SCANSDIR) as $filename) { [$portid, $protocol]) { - echo " \n"; - } +$nmap_services = file("$DATADIR/nmap-services"); +$services = []; +foreach ($nmap_services as $service) { + if (0 !== strpos($service, '#')) { + [$name, $port] = explode("\t", $service); + $services[$name] = explode("/", $port); + } +} +foreach ($services as $name => [$portid, $protocol]) { + echo " \n"; +} ?>