Browse Source

add missed locales whitelist validation #19

main
ghost 1 year ago
parent
commit
90f28cfd8b
  1. 11
      src/Controller/UserController.php

11
src/Controller/UserController.php

@ -47,8 +47,17 @@ class UserController extends AbstractController @@ -47,8 +47,17 @@ class UserController extends AbstractController
// Update 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(
$request->get('locales')
$locales
);
}

Loading…
Cancel
Save