31
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-06-04 14:30:48 +00:00

Fixed unnecessary checks in php files with no code

This fix makes the GPL 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:17:11 +01:00
parent 202bc27e4f
commit 2d4988c814

View File

@ -80,8 +80,21 @@ class jedcheckerRulesGpl extends JEDcheckerRule
$licenses = $this->params->get('constants');
$licenses = explode(',', $licenses);
$hascode = 0;
foreach ($content AS $key => $line)
{
$tline = trim($line);
if ($tline == '' || $tline == '<?php' || $tline == '?>')
{
continue;
}
if ($tline['0'] != '/' && $tline['0'] != '*')
{
$hascode = 1;
}
// Search for GPL license
$gpl = stripos($line, 'GPL');
@ -120,6 +133,6 @@ class jedcheckerRulesGpl extends JEDcheckerRule
unset($content);
return false;
return $hascode ? false : true;
}
}