add missed locales whitelist validation #19

This commit is contained in:
ghost 2023-10-04 15:35:54 +03:00
parent 4852882243
commit 90f28cfd8b

View File

@ -47,8 +47,17 @@ class UserController extends AbstractController
// Update locales // Update locales
if ($request->get('locales')) if ($request->get('locales'))
{ {
$locales = [];
foreach ((array) $request->get('locales') as $locale)
{
if (in_array($locale, explode('|', $this->getParameter('app.locales'))))
{
$locales[] = $locale;
}
}
$user->setLocales( $user->setLocales(
$request->get('locales') $locales
); );
} }