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

Set port based off of scheme if host doesn't include port #589

Merged
merged 1 commit into from
Nov 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}

wellingguzman marked this conversation as resolved.
Show resolved Hide resolved
Expand Down