Skip to content

Commit

Permalink
Convert full URIs
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner committed May 13, 2021
1 parent 28e3a64 commit 1034e69
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion system/Helpers/url_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1034e69

Please sign in to comment.