mirror of
https://github.com/joomla-extensions/jedchecker.git
synced 2024-12-24 11:25:26 +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:
parent
202bc27e4f
commit
3271601225
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user