studiomitte / friendlycaptcha-typo3

Integration of friendly captcha
Other
4 stars 8 forks source link

Undefined global variable $LANG #20

Open stefwer opened 1 month ago

stefwer commented 1 month ago

PHP 8.2.18 TYPO3 11.5.38

The Log gets spammed by Core: Error handler (FE): PHP Warning: Undefined global variable $LANG in ......../typo3conf/ext/friendlycaptcha_official/Classes/FieldValidator/PowermailValidator.php line 81

could not really debug, because it's the localized error message for bots possible solution:

return $GLOBALS['LANG'] ?? GeneralUtility::makeInstance(LanguageService::class);

or

$result->addError(
      $this->translateErrorMessage('message.invalid', 'friendlycaptcha_official'),
      1689236324
);