mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	note path validation
This commit is contained in:
		@@ -148,6 +148,11 @@ function parseNavigationStateFromUrl(url) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    const hash = url.substr(hashIdx + 1); // strip also the initial '#'
 | 
					    const hash = url.substr(hashIdx + 1); // strip also the initial '#'
 | 
				
			||||||
    const [notePath, paramString] = hash.split("?");
 | 
					    const [notePath, paramString] = hash.split("?");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!notePath.match(/^[_a-z0-9]{4,}(\/[_a-z0-9]{4,})*$/i)) {
 | 
				
			||||||
 | 
					        return {};
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const viewScope = {
 | 
					    const viewScope = {
 | 
				
			||||||
        viewMode: 'default'
 | 
					        viewMode: 'default'
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user