Skip to content

Commit 1034e69

Browse files
committed
Convert full URIs
1 parent 28e3a64 commit 1034e69

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

system/Helpers/url_helper.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ function _get_uri(string $relativePath = '', App $config = null): URI
4242
{
4343
throw new InvalidArgumentException('_get_uri() requires a valid baseURL.');
4444
}
45+
46+
// If a full URI was passed then convert it
4547
if (is_int(strpos($relativePath, '://')))
4648
{
47-
throw new InvalidArgumentException('_get_uri() only accepts relative paths.');
49+
$full = new URI($relativePath);
50+
$relativePath = URI::createURIString(null, null, $full->getPath(), $full->getQuery(), $full->getFragment());
4851
}
4952

5053
$relativePath = URI::removeDotSegments($relativePath);

0 commit comments

Comments
 (0)