修正Request类的baseUrl方法 修正Hook类的警告错误

This commit is contained in:
thinkphp
2016-05-25 10:29:25 +08:00
parent 44e86a7f53
commit 1a02bb7081
4 changed files with 5 additions and 4 deletions

View File

@@ -240,7 +240,8 @@ class Request
$this->baseUrl = $url;
return;
} elseif (!$this->baseUrl) {
$this->baseUrl = rtrim($this->url(), '?' . $this->query());
$str = $this->url();
$this->baseUrl = strpos($str, '?') ? strstr($str, '?', true) : $str;
}
return true === $url ? $this->domain() . $this->baseUrl : $this->baseUrl;
}