Skip to content

Commit

Permalink
Fix 500 error of searching commits (go-gitea#28576)
Browse files Browse the repository at this point in the history
Regression of go-gitea#28454 . Now the string is escaped HTML, so it doesn't
need `| Safe`.

Fix go-gitea#28575
  • Loading branch information
wxiaoguang authored and GiteaBot committed Dec 21, 2023
1 parent 1183002 commit 38c8063
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion templates/code/searchresults.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/search.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 38c8063

Please sign in to comment.