Update wsInstance.js: fix for apostrophes in values#81
Open
D-Groenewegen wants to merge 3 commits intoOpen-CSP:REL1_39from
Open
Update wsInstance.js: fix for apostrophes in values#81D-Groenewegen wants to merge 3 commits intoOpen-CSP:REL1_39from
D-Groenewegen wants to merge 3 commits intoOpen-CSP:REL1_39from
Conversation
If a value contains an apostrophe, the current implementation fails with 'Syntax error, unrecognized expression'. This fix prevents the issue by using double quotes around the value.
I don't think we need to cater for double quotes in values, at least not if the values are returned by the API in the JSON format. If I'm mistaken though and there are exceptions, then something like this should work:
```
let optionSelected = $(select).find('option[value="' + values[i].replaceAll('"', '\\"') + '"]')
```
Collaborator
|
I'd rather do something like |
Author
|
I don't remember the example I was using at the time to test this but your suggestion looks reasonable. The only change I made is to use |
D-Groenewegen
added a commit
to a-g-van-hamel-foundation/FlexForm
that referenced
this pull request
Dec 20, 2025
Same as Open-CSP#81 but for MW 1.43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a value contains an apostrophe, the current implementation fails with 'Syntax error, unrecognized expression'. This fix prevents the issue by using double quotes around the value.
I don't think we need to cater for double quotes in values, at least not if the values are returned by the API in the JSON format. If I'm mistaken though and there are exceptions, then something like this should work: