-
Notifications
You must be signed in to change notification settings - Fork 78
Escaping single quote #36
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
Comments
Both are correct. https://dev.mysql.com/doc/refman/8.0/en/string-literals.html |
@dougwilson Then it should be escaped with 1 slash, not 2 slashes, right? |
It only escapes with one slash. How are you converting the string to see the output? For example if you're using |
|
You're correct, I tested it on Runkit, https://npm.runkit.com/sqlstring and I was fooled |
Ah, I see what you mean. Looks like they echo it out passing through like |
Currently,
sqlstring.escape("jo'hn")
results in'jo\\'hn'
which is not the correct escape for single quote, the correct escape for single quote should be 2 single quote next to each other and the correct end result is'jo''hn'
The text was updated successfully, but these errors were encountered: