diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bd06a2be..8d0deb20b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/system/src/Grav/Common/Uri.php b/system/src/Grav/Common/Uri.php index 10acb28cd..555f4e65b 100644 --- a/system/src/Grav/Common/Uri.php +++ b/system/src/Grav/Common/Uri.php @@ -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; }