Skip to content

[SecurityBundle] Set translator in AccessTokenAuthenticator in Security bundle config #54734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prev Previous commit
Next Next commit
replace mb check with preg_match to avoid mbstring dependency
  • Loading branch information
dwgebler committed Apr 25, 2024
commit 7d3e87a57239d73c39b06f1fb5f499d9df8ccb85
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio

if (null !== $this->translator) {
$errorMessage = $this->translator->trans($exception->getMessageKey(), $exception->getMessageData(), 'security');
if (false === mb_check_encoding($errorMessage, 'ASCII')) {
if (0 !== preg_match('/[^\x00-\x7F]/', $errorMessage)) {
$errorMessage = strtr($exception->getMessageKey(), $exception->getMessageData());
}
} else {
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy