Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b50ef3e commit 7d0f0b2Copy full SHA for 7d0f0b2
1 file changed
EventListener/LocaleListener.php
@@ -17,6 +17,7 @@
17
use Symfony\Component\EventDispatcher\Event;
18
use Lunetics\LocaleBundle\LocaleGuesser\LocaleGuesserManager;
19
use Lunetics\LocaleBundle\Cookie\LocaleCookie;
20
+use Lunetics\LocaleBundle\Validator\LocaleValidator;
21
22
/**
23
* @author Christophe Willemsen <[email protected]/>
@@ -63,6 +64,8 @@ public function onKernelRequest(GetResponseEvent $event)
63
64
$request = $event->getRequest();
65
$manager = $this->guesserManager;
66
if($locale = $manager->runLocaleGuessing($request)){
67
+ $validator = new LocaleValidator();
68
+ $validator->validate($locale);
69
$this->logEvent('Setting [ %s ] as defaultLocale for the Request', $locale);
70
$request->setDefaultLocale($locale);
71
$this->identifiedLocale = $locale;
0 commit comments