Skip to content

Commit

Permalink
Issue #546 - Fix issue with unable to detect routes properly when the…
Browse files Browse the repository at this point in the history
…re are multiple consecutive slashes before locale. (#547)
  • Loading branch information
bs-thomas authored and Marc Cámara committed Apr 25, 2018
1 parent 677526f commit 6cd1756
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public function handle($request, Closure $next)

$currentLocale = app('laravellocalization')->getCurrentLocale();
$defaultLocale = app('laravellocalization')->getDefaultLocale();
$params = explode('/', $request->path());
$params = explode('/', $request->getPathInfo());
// Dump the first element (empty string) as getPathInfo() always returns a leading slash
array_shift($params);

if (count($params) > 0) {
$localeCode = $params[0];
Expand Down

0 comments on commit 6cd1756

Please sign in to comment.