From d38500be94a466cdc7885eda66fbcf547d59b23b Mon Sep 17 00:00:00 2001 From: James Addison Date: Fri, 19 Jul 2024 17:33:45 +0100 Subject: [PATCH] [HTML search] Safety guard: restore `escapedWord` conditional check before partial term match result collection. --- sphinx/themes/basic/static/searchtools.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sphinx/themes/basic/static/searchtools.js b/sphinx/themes/basic/static/searchtools.js index f845547bcc9..6261f879fa8 100644 --- a/sphinx/themes/basic/static/searchtools.js +++ b/sphinx/themes/basic/static/searchtools.js @@ -531,7 +531,8 @@ const Search = { } candidateTerms.forEach((term) => { - arr.push({ files: terms[term], score: Scorer.partialTerm }); + if (term.match(escapedWord)) + arr.push({ files: terms[term], score: Scorer.partialTerm }); }); } if (!titleTerms.hasOwnProperty(word)) {