mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
改进Request类的root方法
This commit is contained in:
@@ -288,7 +288,11 @@ class Request
|
|||||||
$this->root = $url;
|
$this->root = $url;
|
||||||
return;
|
return;
|
||||||
} elseif (!$this->root) {
|
} 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;
|
return true === $url ? $this->domain() . $this->root : $this->root;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user