From d898ab35de7140f5a9d0836baedd8e3fefa6541d Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 21 Dec 2016 12:06:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRequest=E7=B1=BBdomain?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/think/Request.php b/library/think/Request.php index 2b0fda30..9cd4ccf1 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -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; }