Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fiks for kommentarer

  • Loading branch information...
commit 402764d15568a4dda2427a3b5e00e4c856d7c1bc 1 parent 9521062
@eoftedal authored
Showing with 12 additions and 11 deletions.
  1. +12 −11 lib/helmet.js
View
23 lib/helmet.js
@@ -43,20 +43,21 @@ var helmet = {
return true;
}
} else {
- for (var a = 0; a < node.attributes.length; a++) {
- var attr = node.attributes[a];
- if (attr.nodeValue.indexOf(tag.key) > -1) {
- if (helmet.isUri(attr.nodeName)) {
- tag.func = "escapeUri";
- } else if (helmet.isEventHandler(attr.nodeName)) {
- tag.func = helmet.checkJS(attr.nodeValue, tag);
- } else {
- tag.func = "escapeHtmlAttribute";
+ if (node.attributes) {
+ for (var a = 0; a < node.attributes.length; a++) {
+ var attr = node.attributes[a];
+ if (attr.nodeValue.indexOf(tag.key) > -1) {
+ if (helmet.isUri(attr.nodeName)) {
+ tag.func = "escapeUri";
+ } else if (helmet.isEventHandler(attr.nodeName)) {
+ tag.func = helmet.checkJS(attr.nodeValue, tag);
+ } else {
+ tag.func = "escapeHtmlAttribute";
+ }
+ return true;
}
- return true;
}
}
-
if (helmet.detect(node, tag)){
return true;
}
Please sign in to comment.
Something went wrong with that request. Please try again.