-
Notifications
You must be signed in to change notification settings - Fork 36
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(apostrophe): fixes issue with apostrophe breaking config #2681
fix(apostrophe): fixes issue with apostrophe breaking config #2681
Conversation
@@ -189,7 +189,7 @@ | |||
// Create a data-config attribute and set config value on the div | |||
const att = document.createAttribute(url ? 'data-config-url' : 'data-config'); | |||
// Clean apostrophes in the config | |||
att.value = JSON.stringify(mapConfig).replace(/'/g, "\\'"); | |||
att.value = mapConfig.replace(/'/g, "\\'"); |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
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.
Done.
c208e7f
to
69f175a
Compare
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.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @Github-advanced-security[bot] and @jolevesq)
@@ -189,7 +189,7 @@ | |||
// Create a data-config attribute and set config value on the div | |||
const att = document.createAttribute(url ? 'data-config-url' : 'data-config'); | |||
// Clean apostrophes in the config | |||
att.value = JSON.stringify(mapConfig).replace(/'/g, "\\'"); | |||
att.value = mapConfig.replace(/'/g, "\\'"); |
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.
Done.
7606951
into
Canadian-Geospatial-Platform:develop
Description
Fixes issue breaking configs by using JSON.stringify on config already stringified
Closes #2629
Type of change
How Has This Been Tested?
https://damonu2.github.io/geoview/demos-navigator.html?config=./configs/navigator/06-basic-footer.json
https://damonu2.github.io/geoview/demo-osdp-integration.html
Checklist:
I have made corresponding changes to the documentationI have added tests that prove my fix is effective or that my feature worksNew and existing unit tests pass locally with my changesThis change is