改进Request的baseUrl方法

This commit is contained in:
thinkphp
2016-05-19 16:57:05 +08:00
parent c006e281cb
commit 9a8b8d8a8d

View File

@@ -216,10 +216,8 @@ class Request
} elseif ($this->baseUrl) {
return $this->baseUrl;
} else {
$url = $this->scheme() . '://' . $this->host();
$url .= $_SERVER['PHP_SELF'];
$this->baseUrl = $url;
return $url;
$this->baseUrl = rtrim($this->url(), '?' . $this->query());
return $this->baseUrl;
}
}