diff options
| author | Maxim <maksimgrinberg01@gmail.com> | 2025-11-21 13:53:11 +0500 |
|---|---|---|
| committer | Maxim <maksimgrinberg01@gmail.com> | 2025-11-21 13:53:11 +0500 |
| commit | 635f4f67a69ee7bf04345fc44c2fe0263692de2b (patch) | |
| tree | a9de30e675d35ea5fb23676145d17443f3428056 | |
| parent | c2094944cfaa82436f2268e7fad0dc9184ad0bcb (diff) | |
| -rw-r--r-- | main.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -459,7 +459,7 @@ func processTemplate(content string, locale *Locale) string { i := 0 for i < len(content) { // Check for include directive: <!-- %include. - if i+14 < len(content) && content[i:i+14] == "<!-- %include." { + if i+14 <= len(content) && content[i:i+14] == "<!-- %include." { // Find end of include directive: % --> endPos := strings.Index(content[i+14:], "% -->") if endPos != -1 { @@ -475,13 +475,13 @@ func processTemplate(content string, locale *Locale) string { result.WriteString(processed) } // Skip past the include directive - i = endPos + 4 // Skip "% -->" + i = endPos + 5 // Skip "% -->" (5 characters) continue } } // Check for locale variable: %locale. - if i+8 < len(content) && content[i:i+8] == "%locale." { + if i+8 <= len(content) && content[i:i+8] == "%locale." { // Find end of locale variable: % endPos := strings.IndexByte(content[i+8:], '%') if endPos != -1 { |
