mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 08:47:52 +00:00
Strip any potential port number from hostname
This commit is contained in:
@@ -164,6 +164,11 @@ class Url implements JsonSerializable
|
|||||||
*/
|
*/
|
||||||
public function setHost(string $host): self
|
public function setHost(string $host): self
|
||||||
{
|
{
|
||||||
|
// Strip any potential ports from hostname
|
||||||
|
if (strpos($host, ':') !== false) {
|
||||||
|
$host = strstr($host, strrchr($host, ':'), true);
|
||||||
|
}
|
||||||
|
|
||||||
$this->host = $host;
|
$this->host = $host;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|||||||
Reference in New Issue
Block a user