From 289538dc6a31d8fb634f64a96c583cf22732cef9 Mon Sep 17 00:00:00 2001 From: getmanenko Date: Tue, 17 May 2016 15:47:10 +0300 Subject: [PATCH] Updated filter value (not removed 0) for url --- src/Module.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Module.php b/src/Module.php index 9b8c8a2..e59d612 100644 --- a/src/Module.php +++ b/src/Module.php @@ -98,7 +98,10 @@ public function init(array $params = array()) SamsonLocale::$leaveDefaultLocale = $this->browserLocaleRedirect; // This should be change to receive path as a parameter on initialization - $pathParts = array_values(array_filter(explode(Route::DELIMITER, $_SERVER['REQUEST_URI']))); + $pathParts = array_values(array_filter(explode(Route::DELIMITER, $_SERVER['REQUEST_URI']), function($v){ + return ($v !== '' && null !== $v); + })); + // Parse URL and store locale found bug $localeFound = SamsonLocale::parseURL($pathParts, $this->browserLocaleRedirect); // Gather URL path parts with removed locale placeholder