You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
build_where_clause() and build_choose_clause() both attempt to escape single quotes in the provided strings. However, they do not handle backslashes, which means it's possible to un-escape the single quote.
The code in build_where_clause and build_choose_clause is not ideal. None of the filtering code does any sanitizing. That job is left up to the developer using this library. I will add a note in the readme.
If someone wants to work on a solution, I would be more than happy to get it merged in!
For what it's worth, in the interim I have seen success performing escaping with .replace('\\', '\\\\').replace("'", "\\'"). Though that's probably not exhaustive, since I have yet to find a full list of control characters in the QBO docs.
Unfortunately, I think fixing this behavior would be a breaking change for this library, since anyone who was pre-escaping their text to work around this would be double-escaping.
I'm having an issue with ampersand being properly escaped. I'm willing to work on a solution, but as @r-thomson points out, this may be a breaking change. I did find this list of "supported characters":
build_where_clause()
andbuild_choose_clause()
both attempt to escape single quotes in the provided strings. However, they do not handle backslashes, which means it's possible to un-escape the single quote.This results in an error from the QuickBooks API, and could also be used to inject additional clauses into the search query.
The text was updated successfully, but these errors were encountered: