2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-05 05:47:17 +08:00

fix(website): open_basedir

This commit is contained in:
耗子
2023-07-28 04:12:06 +08:00
parent 614a5f15b5
commit 5cfeb49468

View File

@@ -303,14 +303,15 @@ func (c *WebsiteController) SaveConfig(ctx http.Context) {
raw = strings.Replace(raw, index, indexNew, -1)
// 防跨站
if !strings.HasSuffix(path, "/") {
path += "/"
root = ctx.Request().Input("root")
if !strings.HasSuffix(root, "/") {
root += "/"
}
if ctx.Request().InputBool("open_basedir") {
tools.WriteFile(path+".user.ini", "open_basedir="+path+":/tmp/", 0644)
tools.WriteFile(root+".user.ini", "open_basedir="+path+":/tmp/", 0644)
} else {
if tools.Exists(path + ".user.ini") {
tools.RemoveFile(path + ".user.ini")
if tools.Exists(root + ".user.ini") {
tools.RemoveFile(root + ".user.ini")
}
}