From aebd3ba0f921fc987b5d319d6f21329c7c1a03d9 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Tue, 22 Jan 2019 10:49:50 -0500 Subject: [PATCH] fix: Fix undefined variable error --- exec/parse_nmap.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/exec/parse_nmap.php b/exec/parse_nmap.php index 7040468..730b948 100644 --- a/exec/parse_nmap.php +++ b/exec/parse_nmap.php @@ -94,7 +94,13 @@ foreach ($lines as $line_num => $line) { $line = trim($line, "\t\n\r"); # chomp would be nice... $matches = []; if (!isset($filetype)) { - if (preg_match('/Starting|\-oN/', $line)) { + if (preg_match('/\.nmap/', $cmd['f'])) { + $filetype = "text"; + } + elseif (preg_match('/\.gnmap/', $cmd['f'])) { + $filetype = "grep"; + } + elseif (preg_match('/Starting|\-oN/', $line)) { $filetype = "text"; } elseif (preg_match('/\-oG/', $line)) {