summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-12-22 10:29:28 +0800
committerGitHub <noreply@github.com>2023-12-22 02:29:28 +0000
commitacc8100d47bab3b13311bcf4c330b19e2153d4ca (patch)
treeb5301f15905cfdf0d97b09ae7078594262018eb9 /templates
parent1a3803effd42df628090b436b44a902482413e45 (diff)
downloadgitea-acc8100d47bab3b13311bcf4c330b19e2153d4ca.tar.gz
gitea-acc8100d47bab3b13311bcf4c330b19e2153d4ca.zip
Fix 500 error of searching commits (#28576) (#28579)
Backport #28576 by wxiaoguang Regression of #28454 . Now the string is escaped HTML, so it doesn't need `| Safe`. Fix #28575 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/code/searchresults.tmpl2
-rw-r--r--templates/repo/search.tmpl2
2 files changed, 2 insertions, 2 deletions
diff --git a/templates/code/searchresults.tmpl b/templates/code/searchresults.tmpl
index 28c33a26de..bb21a5e0dc 100644
--- a/templates/code/searchresults.tmpl
+++ b/templates/code/searchresults.tmpl
@@ -31,7 +31,7 @@
<a href="{{$repo.Link}}/src/commit/{{$result.CommitID | PathEscape}}/{{$result.Filename | PathEscapeSegments}}#L{{.}}"><span>{{.}}</span></a>
{{end}}
</td>
- <td class="lines-code chroma"><code class="code-inner">{{.FormattedLines | Safe}}</code></td>
+ <td class="lines-code chroma"><code class="code-inner">{{.FormattedLines}}</code></td>
</tr>
</tbody>
</table>
diff --git a/templates/repo/search.tmpl b/templates/repo/search.tmpl
index b6c90de32f..b616b4de32 100644
--- a/templates/repo/search.tmpl
+++ b/templates/repo/search.tmpl
@@ -53,7 +53,7 @@
<a href="{{$.SourcePath}}/src/commit/{{PathEscape $result.CommitID}}/{{PathEscapeSegments $result.Filename}}#L{{.}}"><span>{{.}}</span></a>
{{end}}
</td>
- <td class="lines-code chroma"><code class="code-inner">{{.FormattedLines | Safe}}</code></td>
+ <td class="lines-code chroma"><code class="code-inner">{{.FormattedLines}}</code></td>
</tr>
</tbody>
</table>