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
A simple fix would be to replace any single-quote with the Postgresql-friendly doubled single quote SELECT insert_data('I''m here'); (see ex below) but I wonder if there's a.... better way of solving more cases of user-input that could break this. So I asked on StackOverflow
sanitized_input=user_input.replace("'","''")
The text was updated successfully, but these errors were encountered:
I tried inserting a note that read
I'm here...
and the console revealed an error messageThe sql that is being generated here is something like `SELECT insert_data('I'm here');' The issue is in where the sql string to get passed to the Carto sql API is being generated by simple string manipulation https://github.com/mentalhealthawhereness/map/blob/master/index.html#L199-210
A simple fix would be to replace any single-quote with the Postgresql-friendly doubled single quote
SELECT insert_data('I''m here');
(see ex below) but I wonder if there's a.... better way of solving more cases of user-input that could break this. So I asked on StackOverflowThe text was updated successfully, but these errors were encountered: