From 7e8185a5a9e526b3f9c91b7916201a67a2a725eb Mon Sep 17 00:00:00 2001 From: frank goossens Date: Mon, 9 Jan 2017 11:37:22 +0100 Subject: [PATCH] more sanity for getPath $path has to be a file, not a directory (previously e.g. when being passed an empty string, it returned WP_ROOT_DIR), kudo's to @zytzagoo :-) --- classes/autoptimizeBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/autoptimizeBase.php b/classes/autoptimizeBase.php index 06418b2b..594d80d2 100644 --- a/classes/autoptimizeBase.php +++ b/classes/autoptimizeBase.php @@ -104,7 +104,7 @@ protected function getpath($url) { $path = str_replace('//','/',WP_ROOT_DIR.$path); // final check: does file exist and is it readable - if (file_exists($path) && is_readable($path)) { + if (file_exists($path) && is_file($path) && is_readable($path)) { return $path; } else { return false;