From aef18dd4f1e5eb5b8d2101964f7e959d4ac91f93 Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 26 Feb 2024 21:31:17 +0100 Subject: [PATCH] Fix 2 off-by-one errors. --- modules/web/html/html_template.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/web/html/html_template.cpp b/modules/web/html/html_template.cpp index 63d14bb546..5bb3fc2710 100644 --- a/modules/web/html/html_template.cpp +++ b/modules/web/html/html_template.cpp @@ -649,7 +649,7 @@ String HTMLTemplate::render_template(const String &p_text, const Dictionary &p_d // We should have {\\\ . // We cut - result += p_text.substr_index(last_section_start, i - 2); + result += p_text.substr_index(last_section_start, i - 1); // Don't append the now missing {, it will be appended on the next normal text cut @@ -674,7 +674,7 @@ String HTMLTemplate::render_template(const String &p_text, const Dictionary &p_d // i points to: v // ... {{ // cut up to here: ^ (Don't include {{ ) - result += p_text.substr_index(last_section_start, i - 2); + result += p_text.substr_index(last_section_start, i - 1); // i points to: v // ... {{