31
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-06-09 00:32:19 +00:00

clean BOM before JEXEC check

This commit is contained in:
Denis Ryabov 2021-05-17 20:04:37 +03:00
parent f6df5dc520
commit 266ab63780

View File

@ -103,6 +103,9 @@ class JedcheckerRulesJexec extends JEDcheckerRule
// Load file and strip comments
$content = php_strip_whitespace($file);
// Strip BOM (it is checked separately)
$content = preg_replace('/^\xEF\xBB\xBF/', '', $content);
// Skip empty files
if ($content === '' || preg_match('#^<\?php\s+$#', $content))
{