改进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;
} elseif (!$this->domain) {
$this->domain = $this->scheme() . '://' . $this->host();
}
if (80 != $this->port()) {
$this->domain .= ':' . $this->port();
if (!in_array($this->port(), ['80', '443'])) {
$this->domain .= ':' . $this->port();
}
}
return $this->domain;
}