Skip to content

Commit

Permalink
Merge pull request #56 from ARCANEDEV/patch-middleware
Browse files Browse the repository at this point in the history
Updating middleware and other stuff
  • Loading branch information
arcanedev-maroc authored Aug 24, 2016
2 parents 94988c2 + 829cd66 commit 2430a7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Middleware/LocalizationRedirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected function getRedirectionUrl(Request $request)
$this->getCurrentLocale() !== $this->getDefaultLocale() ||
! $this->hideDefaultLocaleInURL()
) {
return localization()->getLocalizedURL(session('locale'), $request->path());
return localization()->getLocalizedURL(session('locale'), $request->fullUrl());
}

return false;
Expand Down
9 changes: 3 additions & 6 deletions src/Utilities/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use Arcanedev\Localization\Contracts\UrlInterface;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use Illuminate\Routing\Router;

/**
* Class Url
Expand All @@ -29,9 +28,6 @@ class Url implements UrlInterface
*/
public static function extractAttributes($url = false)
{
/** @var Router $router */
$router = app('router');

$parse = parse_url($url);
$path = isset($parse['path']) ? explode('/', $parse['path']) : [];
$url = [];
Expand All @@ -40,6 +36,9 @@ public static function extractAttributes($url = false)
if ( ! empty($segment)) $url[] = $segment;
}

/** @var \Illuminate\Routing\Router $router */
$router = app('router');

return self::extractAttributesFromRoutes($url, $router->getRoutes());
}

Expand Down Expand Up @@ -194,8 +193,6 @@ private static function extractAttributesFromSegment($url, $path, $i, $j, $segme
* Check parsed URL.
*
* @param array $parsed
*
* @return array
*/
private static function checkParsedUrl(array &$parsed)
{
Expand Down

0 comments on commit 2430a7c

Please sign in to comment.