Caja-HTML-Sanitizer
Caja-HTML-Sanitizer copied to clipboard
type conversion on boolean variables
hey, I just encountered the problem that a boolean false got converted to the string "false" using your sanitize function:
console.log(typeof(worldhit)); > boolean console.log(typeof(sanitizer.sanitize(worldhit))); > string
the value of the variable is false and since !!"false" === true in javascript, it is always interpreted as true.
Similar problems happening for undefined variables. If I pass an undefined variable, it makes it string "undefined" and all my if(variable) checks afterwards became broken.
Working on a pull request.
Fixed (finally :wink: ) and released in 0.1.3