Skip to content

Commit

Permalink
Prevent error in OptOutManager when language is not a string (#20074)
Browse files Browse the repository at this point in the history
Had the other day close to 80 fatal errors from a scanner where language was not a string which resulted in an error below

> preg_match(): Argument #2 ($subject) must be of type string, array given
  • Loading branch information
tsteur committed Dec 5, 2022
1 parent d49960b commit e7ab21f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/CoreAdminHome/OptOutManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ public function getOptOutViewIFrame()
}
}

$language = Common::getRequestVar('language', '');
$language = Common::getRequestVar('language', '', 'string');
$lang = APILanguagesManager::getInstance()->isLanguageAvailable($language)
? $language
: LanguagesManager::getLanguageCodeForCurrentUser();
Expand Down

0 comments on commit e7ab21f

Please sign in to comment.