From f7806f3ce10a71dfea14659a252fc8ca992d4aec Mon Sep 17 00:00:00 2001 From: ARCANEDEV Date: Mon, 21 Sep 2015 11:23:32 +0100 Subject: [PATCH] Cleaning and fixing stuff --- src/Middleware/LocaleCookieRedirect.php | 6 +----- src/Middleware/LocaleSessionRedirect.php | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Middleware/LocaleCookieRedirect.php b/src/Middleware/LocaleCookieRedirect.php index 03f3884..2fc8bf1 100644 --- a/src/Middleware/LocaleCookieRedirect.php +++ b/src/Middleware/LocaleCookieRedirect.php @@ -2,7 +2,6 @@ use Arcanedev\Localization\Bases\Middleware; use Closure; -use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; /** @@ -39,10 +38,7 @@ public function handle(Request $request, Closure $next) $locale = $request->cookie('locale', null); - if ( - ! is_null($locale) && - ! $this->isDefaultLocaleHidden($locale) - ) { + if (is_string($locale) && ! $this->isDefaultLocaleHidden($locale)) { session()->reflash(); $redirect = $this->getLocalizedRedirect($locale); diff --git a/src/Middleware/LocaleSessionRedirect.php b/src/Middleware/LocaleSessionRedirect.php index db1d1b6..7e2f781 100644 --- a/src/Middleware/LocaleSessionRedirect.php +++ b/src/Middleware/LocaleSessionRedirect.php @@ -38,10 +38,7 @@ public function handle(Request $request, Closure $next) $locale = session('locale', null); - if ( - ! is_null($locale) && - ! $this->isDefaultLocaleHidden($locale) - ) { + if (is_string($locale) && ! $this->isDefaultLocaleHidden($locale)) { session()->reflash(); $redirect = $this->getLocalizedRedirect($locale);