mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-15 14:57:42 +00:00
Explicitly blacklist unsafe elements, starting with <script>
Are there are any other elements that might be considered unsafe?
This commit is contained in:
@@ -30,7 +30,12 @@ ElementWidget.prototype.render = function(parent,nextSibling) {
|
||||
this.parentDomNode = parent;
|
||||
this.computeAttributes();
|
||||
this.execute();
|
||||
var domNode = this.document.createElementNS(this.namespace,this.parseTreeNode.tag);
|
||||
// Neuter blacklisted elements
|
||||
var tag = this.parseTreeNode.tag;
|
||||
if($tw.config.htmlUnsafeElements.indexOf(tag) !== -1) {
|
||||
tag = "safe-" + tag;
|
||||
}
|
||||
var domNode = this.document.createElementNS(this.namespace,tag);
|
||||
this.assignAttributes(domNode,{excludeEventAttributes: true});
|
||||
parent.insertBefore(domNode,nextSibling);
|
||||
this.renderChildren(domNode,null);
|
||||
|
||||
Reference in New Issue
Block a user