diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-12-22 07:09:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-21 23:09:14 +0000 |
commit | 04b235d094218b780b62f024b7ae9716ad2e633f (patch) | |
tree | d1b573ab9dea03b89e5a867f28c6f749b2e02f23 /templates | |
parent | b35d3fddfac389a7be401a63b4e1283dd74af681 (diff) | |
download | gitea-04b235d094218b780b62f024b7ae9716ad2e633f.tar.gz gitea-04b235d094218b780b62f024b7ae9716ad2e633f.zip |
Fix 500 error of searching commits (#28576)
Regression of #28454 . Now the string is escaped HTML, so it doesn't
need `| Safe`.
Fix #28575
Diffstat (limited to 'templates')
-rw-r--r-- | templates/code/searchresults.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/search.tmpl | 2 |
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> |