Skip to content

Commit 7c0600d

Browse files
authored
Merge pull request #51 from Crizz0/issue/50
Fix validation for unsubscribe link in email/ and help/ dir
2 parents f442139 + 028af0d commit 7c0600d

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/Phpbb/TranslationValidator/Validator/FileValidator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,9 @@ public function validateEmail($sourceFile, $originFile)
328328
{
329329
foreach ($validateHtml[0] as $possibleHtml)
330330
{
331-
if (substr($possibleHtml, 0, 5) !== '<!-- ' || substr($possibleHtml, -4) !== ' -->')
331+
if ((substr($possibleHtml, 0, 5) !== '<!-- ' || substr($possibleHtml, -4) !== ' -->')
332+
&& (substr($possibleHtml, 0, 2) !== '<{' || substr($possibleHtml, -2) !== '}>')
333+
)
332334
{
333335
$this->output->addMessage(Output::FATAL, 'Using additional HTML: ' . htmlspecialchars($possibleHtml), $originFile);
334336
}

src/Phpbb/TranslationValidator/Validator/LangKeyValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,8 +741,8 @@ public function validateHtml($file, $key, $sourceString, $originString)
741741
else if (
742742
in_array('</a>', $sourceHtml) ||
743743
$this->originLanguagePath . 'common.php' === $file && $key === 'TRANSLATION_INFO' ||
744-
$this->originLanguagePath . 'help_faq.php' === $file ||
745-
$this->originLanguagePath . 'help_bbcode.php' === $file
744+
$this->originLanguagePath . 'help/faq.php' === $file ||
745+
$this->originLanguagePath . 'help/bbcode.php' === $file
746746
)
747747
{
748748
// Source contains a link aswell, mostly IST changed the link to better match the language

0 commit comments

Comments
 (0)