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

Issue with single quote in string values #6

Open
pierrehebert opened this issue Jan 12, 2017 · 1 comment
Open

Issue with single quote in string values #6

pierrehebert opened this issue Jan 12, 2017 · 1 comment

Comments

@pierrehebert
Copy link

There's an issue when recreating the form where quotes in string values don't get escaped. As a consequence it triggers a javascript error, stopping the creation, and the form appears blank.
This can be fixed with the following change:

diff --git a/multiseek/logic.py b/multiseek/logic.py
index addaf30..06f5c02 100644
--- a/multiseek/logic.py
+++ b/multiseek/logic.py
@@ -735,7 +735,7 @@ class MultiseekRegistry:
                     elem['value'])
 
                 result.append(s % (
-                    current_frame, elem['field'], elem['operator'], value,
+                    current_frame, elem['field'], elem['operator'], value.replace("'", "\\'"),
                     prev_op))
                 info.field += 1
 

@mpasternak
Copy link
Owner

Hey man and thank you for using my software,

your issue has been sitting in my queue for some time, obviously I decided to reply,

I'm thinking if I should write a unit test testing for this exact bug. I mean, I know I should, but ATM I am busy with other projects.

Your code looks legit, but on the other hand, maybe we should use some special slashing function for this? How about ampersand-number sequences in HTML, would this affect quotes too?

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

2 participants