Skip to content

Commit 01e53c3

Browse files
committed
Fix sanitization of document title
1 parent 2cf21a7 commit 01e53c3

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

domain/document/endpoint.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import (
4343
"github.com/documize/community/model/space"
4444
"github.com/documize/community/model/user"
4545
"github.com/documize/community/model/workflow"
46-
"github.com/microcosm-cc/bluemonday"
4746
)
4847

4948
// Handler contains the runtime information such as logging and database.
@@ -271,8 +270,8 @@ func (h *Handler) Update(w http.ResponseWriter, r *http.Request) {
271270
}
272271
}
273272

274-
d.Name = bluemonday.StrictPolicy().Sanitize(d.Name)
275-
d.Excerpt = bluemonday.StrictPolicy().Sanitize(d.Excerpt)
273+
// d.Name = bluemonday.StrictPolicy().Sanitize(d.Name)
274+
// d.Excerpt = bluemonday.StrictPolicy().Sanitize(d.Excerpt)
276275

277276
err = h.Store.Document.Update(ctx, d)
278277
if err != nil {

domain/space/endpoint.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ import (
4444
"github.com/documize/community/model/space"
4545
"github.com/documize/community/model/user"
4646
wf "github.com/documize/community/model/workflow"
47-
"github.com/microcosm-cc/bluemonday"
4847
uuid "github.com/nu7hatch/gouuid"
4948
)
5049

@@ -100,7 +99,7 @@ func (h *Handler) Add(w http.ResponseWriter, r *http.Request) {
10099

101100
var sp space.Space
102101
sp.Name = model.Name
103-
sp.Description = bluemonday.StrictPolicy().Sanitize(model.Description)
102+
// sp.Description = bluemonday.StrictPolicy().Sanitize(model.Description)
104103

105104
sp.Icon = model.Icon
106105
sp.LabelID = model.LabelID

0 commit comments

Comments
 (0)