mirror of
https://github.com/joomla-extensions/jedchecker.git
synced 2025-01-03 14:47:22 +00:00
Merge PR #147 into develop
This commit is contained in:
commit
0bbd95a030
@ -144,15 +144,7 @@ class JedcheckerRulesLanguage extends JEDcheckerRule
|
|||||||
// Check for BOM sequence
|
// Check for BOM sequence
|
||||||
if ($lineno === 0 && strncmp($line, "\xEF\xBB\xBF", 3) === 0)
|
if ($lineno === 0 && strncmp($line, "\xEF\xBB\xBF", 3) === 0)
|
||||||
{
|
{
|
||||||
// Report as an error if BOM is directly followed by key name (and become a part of the name)
|
$this->report->addWarning($file, JText::_('COM_JEDCHECKER_LANG_BOM_FOUND'), $startLineno);
|
||||||
if (isset($line[3]) && strpos(";\n\r", $line[3]) === false)
|
|
||||||
{
|
|
||||||
$this->report->addError($file, JText::_('COM_JEDCHECKER_LANG_BOM_FOUND'), $startLineno);
|
|
||||||
}
|
|
||||||
else // Otherwise report a warning
|
|
||||||
{
|
|
||||||
$this->report->addWarning($file, JText::_('COM_JEDCHECKER_LANG_BOM_FOUND'), $startLineno);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove BOM for further checks
|
// Remove BOM for further checks
|
||||||
$line = substr($line, 3);
|
$line = substr($line, 3);
|
||||||
@ -238,7 +230,7 @@ class JedcheckerRulesLanguage extends JEDcheckerRule
|
|||||||
$value = ltrim($value);
|
$value = ltrim($value);
|
||||||
|
|
||||||
// Parse multiline values
|
// Parse multiline values
|
||||||
while (!preg_match('/^((?>\'(?>[^\'\\\\]+|\\\\.)*\'|"(?>[^"\\\\]+|\\\\.)*"|[^\'";]+)*)(;.*)?$/', $value, $matches))
|
while (!preg_match('/^((?>\'[^\']*\'|"(?>[^"\\\\]+|\\\\.)*"|[^\'";]+)*)(;.*)?$/', $value, $matches))
|
||||||
{
|
{
|
||||||
if ($lineno + 1 >= $nLines)
|
if ($lineno + 1 >= $nLines)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user