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

IBX-7442: Escaped values in JS #1215

Merged
merged 4 commits into from
Mar 19, 2024
Merged

Conversation

mateuszdebinski
Copy link
Contributor

Question Answer
JIRA issue IBX-7442
Type bug
Target version v4.5
Required by https://github.com/ibexa/product-catalog/pull/1139
BC breaks no
Doc needed no

Checklist:

  • Provided PR description.
  • Tested the solution manually.
  • Provided automated test coverage.
  • Checked that target branch is set correctly (master for features, the oldest supported for bugs).
  • Asked for a review (ping @ibexa/engineering).

@bogusez
Copy link
Contributor

bogusez commented Mar 18, 2024

We will need one more fix and another PR to page builder

Screenshot 2024-03-18 at 10 08 54

src/bundle/Resources/public/js/scripts/core/dropdown.js Outdated Show resolved Hide resolved
Comment on lines 15 to 20
return String(str)
.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#039;');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to replace < or >? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mapped the htmlspecialchars functions from PHP and more or less what e('html_attr') does in twig

@mateuszdebinski mateuszdebinski force-pushed the IBX-7442_double_quotes_in_attribute_values branch from 9a4e359 to 16589e6 Compare March 19, 2024 12:06
Copy link

sonarcloud bot commented Mar 19, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@dew326 dew326 merged commit 9838c6d into 4.5 Mar 19, 2024
16 checks passed
@dew326 dew326 deleted the IBX-7442_double_quotes_in_attribute_values branch March 19, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants