GWicke has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/90449


Change subject: WIP: sanitize void tags and drop attributes for end tags
......................................................................

WIP: sanitize void tags and drop attributes for end tags

Change-Id: If236d4c9197b12ff86a607763f25ed7677623bc4
---
M js/lib/ext.core.Sanitizer.js
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid 
refs/changes/49/90449/1

diff --git a/js/lib/ext.core.Sanitizer.js b/js/lib/ext.core.Sanitizer.js
index e209b2b..8d524b1 100644
--- a/js/lib/ext.core.Sanitizer.js
+++ b/js/lib/ext.core.Sanitizer.js
@@ -749,8 +749,11 @@
                        }
 
                        // Sanitize attributes
-                       if (token.constructor === TagTk) {
+                       if (token.constructor === TagTk || token.constructor 
=== EndTagTk) {
                                this.sanitizeTagAttrs(newToken, attribs);
+                       } else {
+                               // EndTagTk, drop attributes
+                               newToken.attribs = [];
                        }
 
                        token = newToken;

-- 
To view, visit https://gerrit.wikimedia.org/r/90449
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If236d4c9197b12ff86a607763f25ed7677623bc4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: GWicke <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to