Skip to content

Commit

Permalink
Proberly handle hostnames with ports in Pico::getBaseUrl() (#472)
Browse files Browse the repository at this point in the history
* fixed getting current port from current host

Resolves #472
  • Loading branch information
mmartellenghi-cb authored and PhrozenByte committed Dec 17, 2018
1 parent cbed65c commit 8494997
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Pico.php
Original file line number Diff line number Diff line change
Expand Up @@ -2054,8 +2054,8 @@ public function getBaseUrl()

$hostPortPosition = ($host[0] === '[') ? strpos($host, ':', strrpos($host, ']') ?: 0) : strrpos($host, ':');
if ($hostPortPosition !== false) {
$host = substr($host, 0, $hostPortPosition);
$port = (int) substr($host, $hostPortPosition + 1);
$host = substr($host, 0, $hostPortPosition);
}

$protocol = 'http';
Expand Down

0 comments on commit 8494997

Please sign in to comment.