Skip to content

Build your personal knowledge base with Trilium Notes

note path validation

zadam6ae7661603f7
diff --git a/src/public/app/services/link.js b/src/public/app/services/link.js
index 6608460ca9..c859b84cf0 100644
--- a/src/public/app/services/link.js
+++ b/src/public/app/services/link.js
@@ -148,6 +148,11 @@ function parseNavigationStateFromUrl(url) {
const hash = url.substr(hashIdx + 1); // strip also the initial '#'
const [notePath, paramString] = hash.split("?");
+
+ if (!notePath.match(/^[_a-z0-9]{4,}(\/[_a-z0-9]{4,})*$/i)) {
+ return {};
+ }
+
const viewScope = {
viewMode: 'default'
};