Skip to content

Commit d75af21

Browse files
authored
Merge pull request #693 from skipperbent/v5-development
Version 5.4.1.2
2 parents 3c03f08 + 6448365 commit d75af21

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Pecee/Http/Url.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ public function getHost(bool $includeTrails = false): ?string
164164
*/
165165
public function setHost(string $host): self
166166
{
167+
// Strip any potential ports from hostname
168+
if (strpos($host, ':') !== false) {
169+
$host = strstr($host, strrchr($host, ':'), true);
170+
}
171+
167172
$this->host = $host;
168173

169174
return $this;

0 commit comments

Comments
 (0)