Strip any potential port number from hostname

This commit is contained in:
Simon
2023-11-27 07:58:49 +01:00
parent d17ee96221
commit 64483652ff

View File

@@ -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;