Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type conversion on boolean variables #6

Open
robinrossow opened this issue Sep 4, 2012 · 2 comments
Open

type conversion on boolean variables #6

robinrossow opened this issue Sep 4, 2012 · 2 comments

Comments

@robinrossow
Copy link

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.

@masumsoft
Copy link
Contributor

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.

@theSmaw
Copy link
Owner

theSmaw commented Dec 15, 2015

Fixed (finally 😉 ) and released in 0.1.3

blaw2422 pushed a commit to blaw2422/Caja-HTML-Sanitizer that referenced this issue Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants