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

GHAS. Translations. Fix Incomplete string escaping or encoding #19375

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

giancorderoortiz
Copy link
Contributor

Fixes https://github.com/SAP/spartacus/security/code-scanning/55

To fix the problem, we need to ensure that backslashes are properly escaped in the stringify function. This can be done by adding a step to replace backslashes with double backslashes before handling other characters. Specifically, we should update the replace method on line 151 to first escape backslashes and then handle double quotes.

  • Update the stringify function to include backslash escaping.
  • Modify the replace method to handle backslashes before replacing double quotes.
  • Ensure that the changes are made in the scripts/i18n/convert-translations-json-2-ts.ts file.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@giancorderoortiz giancorderoortiz changed the title Fix code scanning alert no. 55: Incomplete string escaping or encoding GHAS. Translations. Fix Incomplete string escaping or encoding Oct 9, 2024
@giancorderoortiz giancorderoortiz marked this pull request as ready for review October 9, 2024 21:27
@giancorderoortiz giancorderoortiz requested a review from a team as a code owner October 9, 2024 21:27
Copy link

cypress bot commented Oct 9, 2024

spartacus    Run #45222

Run Properties:  status check passed Passed #45222  •  git commit 3ab55cb35c ℹ️: Merge bfb3288b3771c42a54c17d35c8698176ff552c36 into 9de45d0a4462d8495c7ab460fae6...
Project spartacus
Run status status check passed Passed #45222
Run duration 19m 18s
Commit git commit 3ab55cb35c ℹ️: Merge bfb3288b3771c42a54c17d35c8698176ff552c36 into 9de45d0a4462d8495c7ab460fae6...
Committer Giancarlo Cordero Ortiz
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 3
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 125
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

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

Successfully merging this pull request may close these issues.

1 participant