-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
fix: js and json lang quotes escape #9822
Conversation
1baeaba
to
012b8f2
Compare
This is a big PR ! I still have to double read my changes to be sure. |
templates/api/knowledge-panels/contribution/data_quality_tags.tt.json
Outdated
Show resolved
Hide resolved
Ideally we should add a check that we don't use lang / f_lang without edq or esq if we are inside quotes. (but I don't think of an easy way to do this). |
This is ready for review & merge @stephanegigandet |
lib/ProductOpener/Display.pm
Outdated
@@ -5736,12 +5740,21 @@ sub search_and_export_products ($request_ref, $query_ref, $sort_by) { | |||
return; | |||
} | |||
|
|||
sub escape_char($s, $char) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Maybe this function (and escape_single_quote) could be moved to Text.pm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you!
Quality Gate passedIssues Measures |
Quality Gate passedIssues Measures |
Translations coming from crowdin might contain single quotes or double quotes. So whenever we use lang in a json or javascript string we should escape quotes. I created edq and esq (Escape Single/Double Quotes) function for that (1st commit) and applied it in a lot of place (2nd commit). This should be the pattern to use from now on. fixes: - #9820
Translations coming from crowdin might contain single quotes or double quotes. So whenever we use lang in a json or javascript string we should escape quotes.
I created edq and esq (Escape Single/Double Quotes) function for that (1st commit) and applied it in a lot of place (2nd commit). This should be the pattern to use from now on.
fixes:
Note: I will do a hotfix in prod for the remove account case, because it's important to fix quickly (GDPR).