Comparing version 1.1.1 to 1.1.2
var _ = require('underscore'); | ||
// Escape XML entites in a given string | ||
function esc(str) { | ||
return String(str).replace(/&/g, '&') | ||
.replace(/\"/g, '"') | ||
.replace(/\'/g, ''') | ||
.replace(/</g, '<') | ||
.replace(/>/g, '>'); | ||
} | ||
//helper to generate a helper function which returns XML node for a given parent | ||
@@ -87,3 +96,3 @@ function addTwimlFunction(node, twimlName) { | ||
for (var attr in this.attributes) { | ||
buffer.push(' ' + attr + '="' + this.attributes[attr] + '"'); | ||
buffer.push(' ' + attr + '="' + esc(this.attributes[attr]) + '"'); | ||
} | ||
@@ -96,3 +105,3 @@ | ||
if (this.text) { | ||
buffer.push(this.text); | ||
buffer.push(esc(this.text)); | ||
} | ||
@@ -99,0 +108,0 @@ else { |
{ | ||
"name":"twilio", | ||
"description":"A Twilio helper library", | ||
"version":"1.1.1", | ||
"version":"1.1.2", | ||
"author":"Kevin Whinnery <kevin.whinnery@gmail.com>", | ||
@@ -6,0 +6,0 @@ "contributors":[ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42147
784