diff --git a/src/main/logseq/api/plugin.cljs b/src/main/logseq/api/plugin.cljs index 10ddf84d76..bcaf008fd3 100644 --- a/src/main/logseq/api/plugin.cljs +++ b/src/main/logseq/api/plugin.cljs @@ -59,9 +59,11 @@ (defn- sub-path? [root-dir path] - (let [relative (.relative util/node-path root-dir path)] + (let [relative (.relative util/node-path root-dir path) + parent-dir-segment? (or (= relative "..") + (string/starts-with? relative (str ".." (.-sep util/node-path))))] (or (string/blank? relative) - (and (not (string/starts-with? relative "..")) + (and (not parent-dir-segment?) (not (.isAbsolute util/node-path relative)))))) (defn- assert-storage-path!