Proberly handle hostnames with ports in `Pico::getBaseUrl()` (#472)

* fixed getting current port from current host

Resolves #472
pico-3.0-alpha
M.Martellenghi 7 years ago committed by Daniel Rudolf
parent cbed65cfdf
commit 84949975b0
No known key found for this signature in database
GPG Key ID: A061F02CD8DE4538
  1. 2
      lib/Pico.php

@ -2054,8 +2054,8 @@ class Pico
$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';

Loading…
Cancel
Save