33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-12-25 03:36:00 +00:00

Fixed unnecessary checks in php files with no code (2)

This fix makes the JEXEC check not give false negatives on placeholder files.
So php files with only a comment tag in it.
These don't need GPL info.
This commit is contained in:
Peter van Westen 2013-11-04 15:22:53 +01:00
parent 202bc27e4f
commit 3271601225

View File

@ -78,8 +78,22 @@ class jedcheckerRulesJexec extends JEDcheckerRule
$defines = $this->params->get('constants');
$defines = explode(',', $defines);
$hascode = 0;
foreach ($content AS $line)
{
$tline = trim($line);
if ($tline == '' || $tline == '<?php' || $tline == '?>')
{
continue;
}
if ($tline['0'] != '/' && $tline['0'] != '*')
{
$hascode = 1;
}
// Search for "defined"
$pos_1 = stripos($line, 'defined');
@ -116,6 +130,6 @@ class jedcheckerRulesJexec extends JEDcheckerRule
unset($content);
return false;
return $hascode ? false : true;
}
}