Skip to content

Commit

Permalink
Fix 2 off-by-one errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Relintai committed Feb 26, 2024
1 parent 6ea807b commit aef18dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/web/html/html_template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
// ... {{
Expand Down

0 comments on commit aef18dd

Please sign in to comment.