改进Request类domain方法

This commit is contained in:
thinkphp
2016-12-21 12:06:09 +08:00
parent 8f2ed014cc
commit d898ab35de

View File

@@ -269,9 +269,9 @@ class Request
return $this; return $this;
} elseif (!$this->domain) { } elseif (!$this->domain) {
$this->domain = $this->scheme() . '://' . $this->host(); $this->domain = $this->scheme() . '://' . $this->host();
} if (!in_array($this->port(), ['80', '443'])) {
if (80 != $this->port()) { $this->domain .= ':' . $this->port();
$this->domain .= ':' . $this->port(); }
} }
return $this->domain; return $this->domain;
} }