[FIX] web_editor, website_forum: allow to post videos on the forum
The commit 8749410b10 corrected the way the iframe was rendered to display a video in v9.0.
In v10 though, the html sanitizer is a bit more severe and cleans data-src attributes, preventing the iframe to have a src
This commit works around that and allows the src of the video to be saved in db
OPW 761424
closes #19125
This commit is contained in:
@@ -915,7 +915,7 @@ var VideoDialog = Widget.extend({
|
||||
video_id = this.$("#video_id").val();
|
||||
}
|
||||
var $iframe = $(
|
||||
'<div class="media_iframe_video" data-src="'+this.$iframe.attr("src")+'">'+
|
||||
'<div class="media_iframe_video" data-oe-expression="'+this.$iframe.attr("src")+'">'+
|
||||
'<div class="css_editable_mode_display"> </div>'+
|
||||
'<div class="media_iframe_video_size" contentEditable="false"> </div>'+
|
||||
'<iframe src="'+this.$iframe.attr("src")+'" frameborder="0" allowfullscreen="allowfullscreen" contentEditable="false"></iframe>'+
|
||||
|
||||
@@ -127,7 +127,8 @@ animation.registry.media_video = animation.Class.extend({
|
||||
var size = '<div class="media_iframe_video_size"> </div>';
|
||||
this.$target.html(editor+size);
|
||||
}
|
||||
this.$target.html(this.$target.html()+'<iframe src="'+_.escape(this.$target.data("src"))+'" frameborder="0" allowfullscreen="allowfullscreen"></iframe>');
|
||||
// rebuilding the iframe, from https://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/
|
||||
this.$target.html(this.$target.html()+'<iframe sandbox="allow-scripts allow-same-origin" src="'+_.escape(this.$target.data("oe-expression"))+'" frameborder="0" allowfullscreen="allowfullscreen"></iframe>');
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user