diff --git a/administrator/components/com_jedchecker/libraries/rules/jexec.php b/administrator/components/com_jedchecker/libraries/rules/jexec.php index 8a5ca59..b3d5c29 100644 --- a/administrator/components/com_jedchecker/libraries/rules/jexec.php +++ b/administrator/components/com_jedchecker/libraries/rules/jexec.php @@ -77,7 +77,16 @@ class JedcheckerRulesJexec extends JEDcheckerRule */ protected function find($file) { - $content = (array) file($file); + // load file and strip comments + $content = php_strip_whitespace($file); + + // skip empty files + if ($content === '' || preg_match('#^<\?php\s+$#', $content)) + { + return true; + } + + $content = preg_split('/(?:\r\n|\n|\r)(?!$)/', $content); // Get the constants to look for $defines = $this->params->get('constants');