Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Unified Diff: tools/dom/src/Validators.dart

Issue 1148893004: Make sanitizer tests handle IE11, where tagName can't be clobbered (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/Validators.dart
diff --git a/tools/dom/src/Validators.dart b/tools/dom/src/Validators.dart
index 60d8f35f654ae6320fde3a73cf3c9280566b769b..fd00bb971d4fd4eb29af41e0163227b9283da4d3 100644
--- a/tools/dom/src/Validators.dart
+++ b/tools/dom/src/Validators.dart
@@ -198,6 +198,9 @@ class _ValidatingTreeSanitizer implements NodeTreeSanitizer {
var elementTagName = 'element tag unavailable';
try {
elementTagName = element.tagName;
+ if (elementTagName != elementTagName.toString() {
sra1 2015/05/27 00:45:18 1. Parse error - missing ')'. 2. A malicious toStr
Alan Knight 2015/05/27 19:54:47 OK, this doesn't seem worthwhile, took it out.
+ corrupted = true; // The tag name is not a string
+ }
} catch(e) {}
_sanitizeElement(element, parent, corrupted, elementText, elementTagName,
attrs, isAttr);
@@ -253,7 +256,7 @@ class _ValidatingTreeSanitizer implements NodeTreeSanitizer {
void sanitizeNode(Node node, Node parent) {
switch (node.nodeType) {
case Node.ELEMENT_NODE:
- _sanitizeUntrustedElement(node, parent);
+ _sanitizeUntrustedElement(node, parent);
break;
case Node.COMMENT_NODE:
case Node.DOCUMENT_FRAGMENT_NODE:
« no previous file with comments | « tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698