mirror of
https://github.com/documize/community.git
synced 2025-07-18 20:59:43 +02:00
Fix sanitization of document title
This commit is contained in:
parent
2cf21a7bea
commit
01e53c3d27
2 changed files with 3 additions and 5 deletions
|
@ -43,7 +43,6 @@ import (
|
||||||
"github.com/documize/community/model/space"
|
"github.com/documize/community/model/space"
|
||||||
"github.com/documize/community/model/user"
|
"github.com/documize/community/model/user"
|
||||||
"github.com/documize/community/model/workflow"
|
"github.com/documize/community/model/workflow"
|
||||||
"github.com/microcosm-cc/bluemonday"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Handler contains the runtime information such as logging and database.
|
// Handler contains the runtime information such as logging and database.
|
||||||
|
@ -271,8 +270,8 @@ func (h *Handler) Update(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
d.Name = bluemonday.StrictPolicy().Sanitize(d.Name)
|
// d.Name = bluemonday.StrictPolicy().Sanitize(d.Name)
|
||||||
d.Excerpt = bluemonday.StrictPolicy().Sanitize(d.Excerpt)
|
// d.Excerpt = bluemonday.StrictPolicy().Sanitize(d.Excerpt)
|
||||||
|
|
||||||
err = h.Store.Document.Update(ctx, d)
|
err = h.Store.Document.Update(ctx, d)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -44,7 +44,6 @@ import (
|
||||||
"github.com/documize/community/model/space"
|
"github.com/documize/community/model/space"
|
||||||
"github.com/documize/community/model/user"
|
"github.com/documize/community/model/user"
|
||||||
wf "github.com/documize/community/model/workflow"
|
wf "github.com/documize/community/model/workflow"
|
||||||
"github.com/microcosm-cc/bluemonday"
|
|
||||||
uuid "github.com/nu7hatch/gouuid"
|
uuid "github.com/nu7hatch/gouuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -100,7 +99,7 @@ func (h *Handler) Add(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var sp space.Space
|
var sp space.Space
|
||||||
sp.Name = model.Name
|
sp.Name = model.Name
|
||||||
sp.Description = bluemonday.StrictPolicy().Sanitize(model.Description)
|
// sp.Description = bluemonday.StrictPolicy().Sanitize(model.Description)
|
||||||
|
|
||||||
sp.Icon = model.Icon
|
sp.Icon = model.Icon
|
||||||
sp.LabelID = model.LabelID
|
sp.LabelID = model.LabelID
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue