mirror of
https://github.com/joomla-extensions/jedchecker.git
synced 2024-11-17 02:25:10 +00:00
show line number and code in the encoding rule
This commit is contained in:
parent
21faa210dc
commit
54060ee451
@ -61,8 +61,7 @@ class JedcheckerRulesEncoding extends JEDcheckerRule
|
|||||||
// Try to find the base64 use in the file
|
// Try to find the base64 use in the file
|
||||||
if ($this->find($file))
|
if ($this->find($file))
|
||||||
{
|
{
|
||||||
// Add as error to the report if it was not found
|
// The error has been added by the find() method
|
||||||
$this->report->addError($file, JText::_('COM_JEDCHECKER_ERROR_ENCODING'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -82,22 +81,29 @@ class JedcheckerRulesEncoding extends JEDcheckerRule
|
|||||||
// Get the functions to look for
|
// Get the functions to look for
|
||||||
$encodings = explode(',', $this->params->get('encodings'));
|
$encodings = explode(',', $this->params->get('encodings'));
|
||||||
|
|
||||||
foreach ($encodings as $encoding)
|
foreach ($encodings as $i => $encoding)
|
||||||
{
|
{
|
||||||
$encoding = trim($encoding);
|
$encodings[$i] = trim($encoding);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($content AS $line)
|
$found = false;
|
||||||
|
|
||||||
|
foreach ($content as $i => $line)
|
||||||
|
{
|
||||||
|
foreach ($encodings as $encoding)
|
||||||
{
|
{
|
||||||
// Search for "base64"
|
// Search for "base64"
|
||||||
$pos_1 = stripos($line, $encoding);
|
$pos_1 = stripos($line, $encoding);
|
||||||
|
|
||||||
if ($pos_1 !== false)
|
if ($pos_1 !== false)
|
||||||
{
|
{
|
||||||
return true;
|
$found = true;
|
||||||
|
$this->report->addError($file, JText::_('COM_JEDCHECKER_ERROR_ENCODING'), $i + 1, $line);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return $found;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user