diff --git a/library/think/Request.php b/library/think/Request.php index d80e5983..3787d11a 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -289,7 +289,7 @@ class Request return; } elseif (!$this->root) { $file = $this->baseFile(); - if (0 !== strpos($this->url(), $file)) { + if ($file && 0 !== strpos($this->url(), $file)) { $file = str_replace('\\', '/', dirname($file)); } $this->root = rtrim($file, '/');