33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-11-11 07:41:04 +00:00

Merge pull request #15 from nonumber/patch-1

Fixed unnecessary GPL checks in php files with no code
This commit is contained in:
Daniel Dimitrov 2013-11-05 11:26:34 -08:00
commit 978b38a0b5

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;
}
}