31
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-05-30 12:20:47 +00:00

Merge PR #167 into develop

This commit is contained in:
Llewellyn van der Merwe 2021-12-05 19:46:23 +02:00
commit 788babd579
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C
2 changed files with 8 additions and 0 deletions

View File

@ -83,6 +83,7 @@ COM_JEDCHECKER_ERROR_FRAMEWORK_TODO="TODO statement detected"
COM_JEDCHECKER_ERROR_FRAMEWORK_LEFTOVER_FOLDER="Leftover folder detected"
COM_JEDCHECKER_ERROR_FRAMEWORK_LEFTOVER_FILE="Leftover file detected"
COM_JEDCHECKER_ERROR_FRAMEWORK_STRICT="PHP Strict Standards: Only variables should be assigned by reference"
COM_JEDCHECKER_ERROR_FRAMEWORK_LEADING_SPACES="Spaces at the beginning of PHP file detected (it might result in the 'Cannot modify header information - headers already sent' warning message)"
COM_JEDCHECKER_RULE_JAMSS="JAMSS - Joomla! Anti-Malware Scan Script"
COM_JEDCHECKER_RULE_JAMSS_DESC="JAMSS will raise many flags for use of potentially dangerous methods, additionally checking for some known attack signatures. Find out more on the <a href='https://github.com/btoplak/Joomla-Anti-Malware-Scan-Script' target='_blank'>Project's homepage</a><br>JAMSS output is very verbose and very useful, hover over any lines to see the details."
COM_JEDCHECKER_ERROR_JAMSS_SUSPICIOUS_FILENAME="Suspicious filename found :"

View File

@ -158,6 +158,13 @@ class JedcheckerRulesFramework extends JEDcheckerRule
$result = true;
}
// Report spaces/tabs/EOLs at the beginning of file
if (strpos(" \t\n\r\v\f", $content[0]) !== false)
{
$this->report->addNotice($file, JText::_('COM_JEDCHECKER_ERROR_FRAMEWORK_LEADING_SPACES'));
$result = true;
}
// Clean non-code
$content = JEDCheckerHelper::cleanPhpCode(
$content,