Permalink
Browse files

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
:-)
  • Loading branch information...
1 parent 49ad0ce commit 7e8185a5a9e526b3f9c91b7916201a67a2a725eb @futtta committed Jan 9, 2017
Showing with 1 addition and 1 deletion.
  1. +1 −1 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;

0 comments on commit 7e8185a

Please sign in to comment.