Permalink
Browse files

Using htmlEscape

  • Loading branch information...
1 parent e9177b7 commit 98f68c3434b17706874b2dcefa7bb67d0b18c5bb Jordan Harband committed Feb 12, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/widgets.js
View
@@ -1,4 +1,5 @@
/*jslint node: true */
+var htmlEscape = require('./htmlEscape');
// generates a string for common widget attributes
var attrs = function (a, needsID) {
@@ -20,7 +21,7 @@ var attrs = function (a, needsID) {
value = null;
}
if (typeof value !== 'undefined' && value !== null) {
- pairs.push(field + '="' + value + '"');
+ pairs.push(htmlEscape(field) + '="' + htmlEscape(value) + '"');
}
});
return pairs.length > 0 ? ' ' + pairs.join(' ') : '';

0 comments on commit 98f68c3

Please sign in to comment.