mirror of
https://github.com/joomla-extensions/jedchecker.git
synced 2025-01-12 01:45:39 +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:
commit
f54f87308b
@ -78,8 +78,22 @@ class jedcheckerRulesJexec extends JEDcheckerRule
|
|||||||
$defines = $this->params->get('constants');
|
$defines = $this->params->get('constants');
|
||||||
$defines = explode(',', $defines);
|
$defines = explode(',', $defines);
|
||||||
|
|
||||||
|
$hascode = 0;
|
||||||
|
|
||||||
foreach ($content AS $line)
|
foreach ($content AS $line)
|
||||||
{
|
{
|
||||||
|
$tline = trim($line);
|
||||||
|
|
||||||
|
if ($tline == '' || $tline == '<?php' || $tline == '?>')
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($tline['0'] != '/' && $tline['0'] != '*')
|
||||||
|
{
|
||||||
|
$hascode = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Search for "defined"
|
// Search for "defined"
|
||||||
$pos_1 = stripos($line, 'defined');
|
$pos_1 = stripos($line, 'defined');
|
||||||
|
|
||||||
@ -116,6 +130,6 @@ class jedcheckerRulesJexec extends JEDcheckerRule
|
|||||||
|
|
||||||
unset($content);
|
unset($content);
|
||||||
|
|
||||||
return false;
|
return $hascode ? false : true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user