Skip to content

Commit 14c2199

Browse files
authored
Merge pull request #695 from skipperbent/v5-development
Version 5.4.1.3
2 parents d75af21 + 565a926 commit 14c2199

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Pecee/Http/Request.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,11 @@ public function setUrl(Url $url): void
405405
*/
406406
public function setHost(?string $host): void
407407
{
408+
// Strip any potential ports from hostname
409+
if (strpos($host, ':') !== false) {
410+
$host = strstr($host, strrchr($host, ':'), true);
411+
}
412+
408413
$this->host = $host;
409414
}
410415

src/Pecee/Http/Url.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,6 @@ 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-
172167
$this->host = $host;
173168

174169
return $this;

0 commit comments

Comments
 (0)