Skip to content

Commit

Permalink
Cleaning and fixing stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Sep 21, 2015
1 parent 46a40fc commit f7806f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
6 changes: 1 addition & 5 deletions src/Middleware/LocaleCookieRedirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

use Arcanedev\Localization\Bases\Middleware;
use Closure;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;

/**
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/Middleware/LocaleSessionRedirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f7806f3

Please sign in to comment.