Skip to content

Commit

Permalink
more sanity for getPath
Browse files Browse the repository at this point in the history
$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
futtta committed Jan 9, 2017
1 parent 49ad0ce commit 7e8185a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/autoptimizeBase.php
Expand Up @@ -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;
Expand Down

0 comments on commit 7e8185a

Please sign in to comment.