Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Set port based off of scheme if host doesn't include port (#589)
Browse files Browse the repository at this point in the history
Fixes #595
  • Loading branch information
Anthonyzou authored and wellingguzman committed Nov 26, 2018
1 parent c28c7ab commit d91c0d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/helpers/all.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,16 @@ function create_uri_from_global()

if (isset($matches[2])) {
$port = (int)substr($matches[2], 1);
} else {
$port = $isSecure ? 443 : 80;
}
} else {
$pos = strpos($host, ':');
if ($pos !== false) {
$port = (int)substr($host, $pos + 1);
$host = strstr($host, ':', true);
} else {
$port = $isSecure ? 443 : 80;
}
}

Expand Down

0 comments on commit d91c0d0

Please sign in to comment.