mirror of
https://github.com/getgrav/grav.git
synced 2026-07-06 10:29:30 +02:00
Fix for Utils::url and extra base_url
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
* Grav 1.6: Fixed Flex erroring out with all numeric keys in storage
|
||||
* Grav 1.6: Fixed error in `FlexUserIndex` if there are users without an email address
|
||||
* Grav 1.6: Fixed bad key in Flex Users if file storage is being used
|
||||
* Fixed issue with `Utils::url()` method would append extra `base_url` if URL already included it
|
||||
|
||||
# v1.6.0-rc.4
|
||||
## 03/20/2019
|
||||
|
||||
@@ -43,6 +43,12 @@ abstract class Utils
|
||||
return $input;
|
||||
}
|
||||
|
||||
/** @var Uri $uri */
|
||||
$uri = Grav::instance()['uri'];
|
||||
|
||||
$root = $uri->rootUrl();
|
||||
$input = Utils::replaceFirstOccurrence($root, '', $input);
|
||||
|
||||
$input = ltrim((string)$input, '/');
|
||||
|
||||
if (Utils::contains((string)$input, '://')) {
|
||||
@@ -67,8 +73,7 @@ abstract class Utils
|
||||
$resource = $input;
|
||||
}
|
||||
|
||||
/** @var Uri $uri */
|
||||
$uri = Grav::instance()['uri'];
|
||||
|
||||
|
||||
return $resource ? rtrim($uri->rootUrl($domain), '/') . '/' . $resource : null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user