33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2025-01-11 17:38:49 +00:00

Merge pull request #16 from nonumber/patch-2

Fixed unnecessary JEXEC checks in php files with no code
This commit is contained in:
Daniel Dimitrov 2013-11-05 11:25:20 -08:00
commit f54f87308b

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