mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-02 13:44:16 +09:00
fix: replace null char with space for issue/comment content (#40014)
A simple workaround to fix #40003
This commit is contained in:
1 parent
f0bb283a17
commit
879ebfb3d8
3 files changed
+45
No files matched your search
@@ -720,3 +720,15 @@ func TestIssueRefSelectorEnabledForPoster(t *testing.T) {
|
||||
_, hasURL := sel.Attr("data-url-update-issueref")
|
||||
assert.True(t, hasURL, "data-url-update-issueref must be set for the issue poster")
|
||||
}
|
||||
|
||||
func TestIssueCommentContent(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
issue := &issues_model.Issue{Title: "title\x00content", Content: "body\x00content"}
|
||||
require.NoError(t, db.Insert(t.Context(), issue))
|
||||
unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: issue.ID, Title: "title content", Content: "body content"})
|
||||
|
||||
comment := &issues_model.Comment{Content: "body\x00content"}
|
||||
require.NoError(t, db.Insert(t.Context(), comment))
|
||||
unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: comment.ID, Content: "body content"})
|
||||
}
|
||||
Reference in new issue
Block a user