Skip to content

Commit acc8100

Browse files
GiteaBotwxiaoguang
andauthored
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>
1 parent 1a3803e commit acc8100

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

templates/code/searchresults.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<a href="{{$repo.Link}}/src/commit/{{$result.CommitID | PathEscape}}/{{$result.Filename | PathEscapeSegments}}#L{{.}}"><span>{{.}}</span></a>
3232
{{end}}
3333
</td>
34-
<td class="lines-code chroma"><code class="code-inner">{{.FormattedLines | Safe}}</code></td>
34+
<td class="lines-code chroma"><code class="code-inner">{{.FormattedLines}}</code></td>
3535
</tr>
3636
</tbody>
3737
</table>

templates/repo/search.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<a href="{{$.SourcePath}}/src/commit/{{PathEscape $result.CommitID}}/{{PathEscapeSegments $result.Filename}}#L{{.}}"><span>{{.}}</span></a>
5454
{{end}}
5555
</td>
56-
<td class="lines-code chroma"><code class="code-inner">{{.FormattedLines | Safe}}</code></td>
56+
<td class="lines-code chroma"><code class="code-inner">{{.FormattedLines}}</code></td>
5757
</tr>
5858
</tbody>
5959
</table>

0 commit comments

Comments
 (0)