mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +08:00
改进Request类的root方法
This commit is contained in:
@@ -288,7 +288,11 @@ class Request
|
||||
$this->root = $url;
|
||||
return;
|
||||
} elseif (!$this->root) {
|
||||
$this->root = rtrim(str_replace('\\', '/', dirname($this->baseFile())), '/');
|
||||
$file = $this->baseFile();
|
||||
if (0 !== strpos($this->url(), $file)) {
|
||||
$file = str_replace('\\', '/', dirname($file));
|
||||
}
|
||||
$this->root = rtrim($file, '/');
|
||||
}
|
||||
return true === $url ? $this->domain() . $this->root : $this->root;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user