Fix for illegal offset scheme errors

This commit is contained in:
Andy Miller
2017-12-08 11:52:48 -07:00
parent 70f6529e32
commit 6628bbbe2f
2 changed files with 12 additions and 7 deletions

View File

@@ -1,11 +1,15 @@
# v1.3.11
## mm/dd/2017
1. [](#bugfix)
* Fixed issue with _illegal scheme offset_ in `Uri::convertUrl()` [page-inject#8](https://github.com/getgrav/grav-plugin-page-inject/issues/8)
# v1.3.10
## 12/06/2017
1. [](#bugfix)
* Reverted GPM Local pull request as it broken admin [#1742](https://github.com/getgrav/grav/issues/1742)
1. [](#new)
# v1.3.9
## 12/05/2017

View File

@@ -941,7 +941,7 @@ class Uri
}
// handle absolute URLs
if (!$external && ($absolute === true || $grav['config']->get('system.absolute_urls', false))) {
if (is_array($url) && !$external && ($absolute === true || $grav['config']->get('system.absolute_urls', false))) {
$url['scheme'] = $uri->scheme(true);
$url['host'] = $uri->host();
@@ -983,6 +983,11 @@ class Uri
}
}
// Handle route only
if ($route_only) {
$url_path = str_replace($base_url, '', $url_path);
}
// transform back to string/array as needed
if (is_array($url)) {
$url['path'] = $url_path;
@@ -990,10 +995,6 @@ class Uri
$url = $url_path;
}
if ($route_only) {
$url = str_replace($base_url, '', $url);
}
return $url;
}