forked from mirror/MrDoc
修复ice富文本编辑器中插入图片URL链接的XSS漏洞
This commit is contained in:
parent
5034ca74f2
commit
46ef5326e4
@ -393,7 +393,8 @@ insertImg = function(e){
|
||||
// 按钮点击插入输入框图片链接
|
||||
insertImgUrl = function(){
|
||||
if(editor_mode == 3){
|
||||
editor.addValue('<img src="' + $("#img_url_input").val() + '" />')
|
||||
img_str = DOMPurify.sanitize('<img src="' + $("#img_url_input").val() + '" />',{ADD_TAGS: ['iframe']})
|
||||
editor.addValue(img_str)
|
||||
}else{
|
||||
editor.insertValue("\n![](" + $("#img_url_input").val() + ")");
|
||||
editor.focus()
|
||||
|
@ -234,6 +234,7 @@
|
||||
{% elif editor_mode == 3 %}
|
||||
<!-- iceEditor富文本编辑器 -->
|
||||
<script src="{% static 'iceEditor/src/iceEditor.min.js' %}?version={{mrdoc_version}}"></script>
|
||||
<script src="{% static 'editor.md/lib/purify.min.js' %}?version={{mrdoc_version}}"></script>
|
||||
{% include 'app_doc/editor/tpl_editor_ice.html' %}
|
||||
{% elif editor_mode == 4 %}
|
||||
<!-- 在线表格 -->
|
||||
|
@ -272,7 +272,7 @@
|
||||
var content = editor.getHTML()
|
||||
var pre_content = editor.getValue()
|
||||
}else if(editor_mode == 3){
|
||||
var content = editor.getHTML()
|
||||
var content = DOMPurify.sanitize(editor.getHTML(),{ADD_TAGS: ['iframe']})
|
||||
var pre_content = editor.getText()
|
||||
}else if(editor_mode == 4){
|
||||
var content = '';
|
||||
|
@ -249,7 +249,7 @@
|
||||
var content = editor.getHTML()
|
||||
var pre_content = editor.getValue()
|
||||
}else if(editor_mode == 3){
|
||||
var content = editor.getHTML()
|
||||
var content = DOMPurify.sanitize(editor.getHTML(),{ADD_TAGS: ['iframe']})
|
||||
var pre_content = editor.getText()
|
||||
}else if(editor_mode == 4){
|
||||
var content = '';
|
||||
|
Loading…
Reference in New Issue
Block a user