mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-15 18:23:26 +03: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
|
||||
{
|
||||
// Strip any potential ports from hostname
|
||||
if (strpos($host, ':') !== false) {
|
||||
$host = strstr($host, strrchr($host, ':'), true);
|
||||
}
|
||||
|
||||
$this->host = $host;
|
||||
|
||||
return $this;
|
||||
|
||||
Reference in New Issue
Block a user