From cbdb81257264f9e8410f2432331e240ff72e2dce Mon Sep 17 00:00:00 2001 From: Marek Knappe Date: Tue, 23 Oct 2018 17:06:42 +1000 Subject: [PATCH] Add real path conversion for cli scan.php to have relative path. Also it runs for cwd() dir if no dir given Closes #31 --- scan.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scan.php b/scan.php index 6656ceb..1dbbdb4 100644 --- a/scan.php +++ b/scan.php @@ -64,10 +64,11 @@ class MalwareScanner if ($cli === true) { //Read Run Options $this->parseArgs(); + $this->dir = realpath($this->dir); //Make sure a directory was specified. if ($this->dir === '') { - $this->error('No directory specified'); + $this->error('No directory specified or directory doesn\'t exist'); exit(-1); }