[FIX] web_editor: encoding of the attachment name is missing in image src

This commit is contained in:
Christophe Matthieu
2018-02-08 11:25:51 +01:00
parent d2f9994e92
commit 152e3f8686
@@ -305,7 +305,7 @@ var ImageDialog = Widget.extend({
return (r.url || r.id);
});
_.each(this.records, function (record) {
record.src = record.url || _.str.sprintf('/web/image/%s/%s', record.id, record.name); // Name is added for SEO purposes
record.src = record.url || _.str.sprintf('/web/image/%s/%s', record.id, encodeURI(record.name)); // Name is added for SEO purposes
record.is_document = !(/gif|jpe|jpg|png/.test(record.mimetype));
});
this.display_attachments();