diff --git a/system/Helpers/url_helper.php b/system/Helpers/url_helper.php index d854fc9bfa2e..f58045ae73a7 100644 --- a/system/Helpers/url_helper.php +++ b/system/Helpers/url_helper.php @@ -42,9 +42,12 @@ function _get_uri(string $relativePath = '', App $config = null): URI { throw new InvalidArgumentException('_get_uri() requires a valid baseURL.'); } + + // If a full URI was passed then convert it if (is_int(strpos($relativePath, '://'))) { - throw new InvalidArgumentException('_get_uri() only accepts relative paths.'); + $full = new URI($relativePath); + $relativePath = URI::createURIString(null, null, $full->getPath(), $full->getQuery(), $full->getFragment()); } $relativePath = URI::removeDotSegments($relativePath);