Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d0f0b2

Browse files
committed
listener validates now the locale
1 parent b50ef3e commit 7d0f0b2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

EventListener/LocaleListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Symfony\Component\EventDispatcher\Event;
1818
use Lunetics\LocaleBundle\LocaleGuesser\LocaleGuesserManager;
1919
use Lunetics\LocaleBundle\Cookie\LocaleCookie;
20+
use Lunetics\LocaleBundle\Validator\LocaleValidator;
2021

2122
/**
2223
* @author Christophe Willemsen <[email protected]/>
@@ -63,6 +64,8 @@ public function onKernelRequest(GetResponseEvent $event)
6364
$request = $event->getRequest();
6465
$manager = $this->guesserManager;
6566
if($locale = $manager->runLocaleGuessing($request)){
67+
$validator = new LocaleValidator();
68+
$validator->validate($locale);
6669
$this->logEvent('Setting [ %s ] as defaultLocale for the Request', $locale);
6770
$request->setDefaultLocale($locale);
6871
$this->identifiedLocale = $locale;

0 commit comments

Comments
 (0)