From ab4acc2bba4f2521a2aed79bff4307c2443bf4fb Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Sun, 4 Apr 2021 12:07:11 +0300 Subject: [PATCH] unify code lines displaying --- .../libraries/rules/language.php | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/administrator/components/com_jedchecker/libraries/rules/language.php b/administrator/components/com_jedchecker/libraries/rules/language.php index 5c34171..54fff9c 100644 --- a/administrator/components/com_jedchecker/libraries/rules/language.php +++ b/administrator/components/com_jedchecker/libraries/rules/language.php @@ -93,16 +93,14 @@ class JedcheckerRulesLanguage extends JEDcheckerRule // Report incorrect comment character if ($line[0] === '#') { - $this->report->addError($file, JText::_('COM_JEDCHECKER_LANG_INCORRECT_COMMENT') . - '
' . htmlspecialchars($line), $lineno); + $this->report->addError($file, JText::_('COM_JEDCHECKER_LANG_INCORRECT_COMMENT'), $lineno, $line); continue; } // Check for "=" character in the line if (strpos($line, '=') === false) { - $this->report->addError($file, JText::_('COM_JEDCHECKER_LANG_WRONG_LINE') . - '
' . htmlspecialchars($line), $lineno); + $this->report->addError($file, JText::_('COM_JEDCHECKER_LANG_WRONG_LINE'), $lineno, $line); continue; } @@ -114,32 +112,28 @@ class JedcheckerRulesLanguage extends JEDcheckerRule // Check for empty key if ($key === '') { - $this->report->addError($file, JText::_('COM_JEDCHECKER_LANG_KEY_EMPTY') . - '
' . htmlspecialchars($line), $lineno); + $this->report->addError($file, JText::_('COM_JEDCHECKER_LANG_KEY_EMPTY'), $lineno, $line); continue; } // Check for spaces in the key name if (strpos($key, ' ') !== false) { - $this->report->addError($file, JText::_('COM_JEDCHECKER_LANG_KEY_WHITESPACE') . - '
' . htmlspecialchars($line), $lineno); + $this->report->addError($file, JText::_('COM_JEDCHECKER_LANG_KEY_WHITESPACE'), $lineno, $line); continue; } // Check for invalid characters (see https://www.php.net/manual/en/function.parse-ini-file.php) if (strpbrk($key, '{}|&~![()^"') !== false) { - $this->report->addError($file, JText::_('COM_JEDCHECKER_LANG_KEY_INVALID_CHARACTER') . - '
' . htmlspecialchars($line), $lineno); + $this->report->addError($file, JText::_('COM_JEDCHECKER_LANG_KEY_INVALID_CHARACTER'), $lineno, $line); continue; } // Check for invalid key names (see https://www.php.net/manual/en/function.parse-ini-file.php) if (in_array($key, array('null', 'yes', 'no', 'true', 'false', 'on', 'off', 'none'), true)) { - $this->report->addError($file, JText::_('COM_JEDCHECKER_LANG_KEY_RESERVED') . - '
' . htmlspecialchars($line), $lineno); + $this->report->addError($file, JText::_('COM_JEDCHECKER_LANG_KEY_RESERVED'), $lineno, $line); continue; } @@ -147,16 +141,14 @@ class JedcheckerRulesLanguage extends JEDcheckerRule if (strlen($value) <2 || $value[0] !== '"' || substr($value, -1) !== '"') { - $this->report->addError($file, JText::_('COM_JEDCHECKER_LANG_TRANSLATION_QUOTES') . - '
' . htmlspecialchars($line), $lineno); + $this->report->addError($file, JText::_('COM_JEDCHECKER_LANG_TRANSLATION_QUOTES'), $lineno, $line); continue; } // Check for empty value if ($value === '""') { - $this->report->addWarning($file, JText::_('COM_JEDCHECKER_LANG_TRANSLATION_EMPTY') . - '
' . htmlspecialchars($line), $lineno); + $this->report->addWarning($file, JText::_('COM_JEDCHECKER_LANG_TRANSLATION_EMPTY'), $lineno, $line); continue; } @@ -166,8 +158,7 @@ class JedcheckerRulesLanguage extends JEDcheckerRule // Check for legacy "_QQ_" code (deprecated since Joomla! 3.9 if favor of escaped double quote \"; removed in Joomla! 4) if (strpos($value, '"_QQ_"') !== false) { - $this->report->addInfo($file, JText::_('COM_JEDCHECKER_LANG_QQ_DEPRECATED') . - '
' . htmlspecialchars($line), $lineno); + $this->report->addInfo($file, JText::_('COM_JEDCHECKER_LANG_QQ_DEPRECATED'), $lineno, $line); } }