Skip to content

Commit

Permalink
Update LaravelLocalization.php (#806)
Browse files Browse the repository at this point in the history
  • Loading branch information
usernotnull authored Jan 26, 2022
1 parent 645819d commit dabb0d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Mcamara/LaravelLocalization/LaravelLocalization.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,6 @@ public function getLocalizedURL($locale = null, $url = null, $attributes = [], $
$attributes = $this->extractAttributes($url, $locale);
}

$urlQuery = parse_url($url, PHP_URL_QUERY);
$urlQuery = $urlQuery ? '?'.$urlQuery : '';

if (empty($url)) {
$url = $this->request->fullUrl();
$urlQuery = parse_url($url, PHP_URL_QUERY);
Expand All @@ -282,6 +279,9 @@ public function getLocalizedURL($locale = null, $url = null, $attributes = [], $
return $this->getURLFromRouteNameTranslated($locale, $this->routeName, $attributes, $forceDefaultLocation) . $urlQuery;
}
} else {
$urlQuery = parse_url($url, PHP_URL_QUERY);
$urlQuery = $urlQuery ? '?'.$urlQuery : '';

$url = $this->url->to($url);
}

Expand Down

0 comments on commit dabb0d4

Please sign in to comment.