From 1034e69c5eb90b457e70539856a9fa7019dd7fa6 Mon Sep 17 00:00:00 2001 From: MGatner Date: Thu, 13 May 2021 01:43:20 +0000 Subject: [PATCH] Convert full URIs --- system/Helpers/url_helper.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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);