33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-11-17 02:25:10 +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 // Load file and strip comments
$content = php_strip_whitespace($file); $content = php_strip_whitespace($file);
// Strip BOM (it is checked separately)
$content = preg_replace('/^\xEF\xBB\xBF/', '', $content);
// Skip empty files // Skip empty files
if ($content === '' || preg_match('#^<\?php\s+$#', $content)) if ($content === '' || preg_match('#^<\?php\s+$#', $content))
{ {