From 110c0b252aa428ab253562a07c7c4a753d563d78 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 16 Oct 2025 13:06:25 +0100 Subject: [PATCH] avoid call to getDocument with random string as item --- static/js/utils.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/static/js/utils.js b/static/js/utils.js index c75698823..e0a9233b3 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -1654,6 +1654,11 @@ pandora.getItem = function(state, str, callback) { } }); } else if (state.type == 'documents') { + if (!pandora.isBase26(str)) { + state.item = ''; + callback(); + return + } pandora.api.getDocument({ id: str, // send keys so that subsequent request when parsing @@ -1702,6 +1707,10 @@ pandora.getItem = function(state, str, callback) { } }; +pandora.isBase26 = function(value) { + return /^[A-Z]+$/.test(value) +}; + pandora.getItemFind = function(find) { var itemFind = ''; Ox.forEach(find.conditions, function(condition) {