Skip to content

Commit 996a238

Browse files
committed
🎨 #17462
Signed-off-by: Daniel <845765@qq.com>
1 parent 192f26f commit 996a238

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

kernel/filesys/tree.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ func LoadTreeByData(data []byte, boxID, p string, luteEngine *lute.Lute) (ret *p
149149
ret.Root.Path = p
150150

151151
parts := strings.Split(p, "/")
152+
if 2 < len(parts) {
153+
logging.LogErrorf("parse tree [%s] failed: invalid path", p)
154+
err = errors.New("invalid path")
155+
return
156+
}
157+
152158
parts = parts[1 : len(parts)-1] // 去掉开头的斜杆和结尾的自己
153159
if 1 > len(parts) {
154160
ret.HPath = "/" + ret.Root.IALAttr("title")

0 commit comments

Comments
 (0)