Skip to content

Commit d928f76

Browse files
committed
Do not change url if it starts with "http"
1 parent 98d3053 commit d928f76

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/LaravelLocale/LocaleUrlGenerator.php

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ function __construct(Config $config, Request $request, UrlGenerator $url)
5353
*/
5454
public function url($path, $extra = [], $secure = null)
5555
{
56+
// Do not modify path if it starts with `http`.
57+
if (preg_match('/^http/', $path)) {
58+
return $this->url->to($path, $extra, $secure);
59+
}
60+
5661
if ($this->isCurrentLocaleDefault()) {
5762
return $this->url->to($path, $extra, $secure);
5863
}

0 commit comments

Comments
 (0)