Skip to content

backmerge #238

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

Merged
merged 165 commits into from
Jul 10, 2025
Merged

backmerge #238

merged 165 commits into from
Jul 10, 2025

Conversation

imantsk
Copy link
Member

@imantsk imantsk commented Jul 10, 2025

No description provided.

ramiy and others added 28 commits April 28, 2025 21:44
Improve i18n, a11y, and security
Use CSS logical properties to support both LTR & RTL
fix: add missing comma to translation string formatting in safe mode notice

if ('markup' === snippetLanguage) {
snippetCodeModalTag.innerHTML = `<xmp>${snippetCode}</xmp>`
snippetCodeModalTag.innerHTML = `<xmp>${snippetCodeInput.value}</xmp>`

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML Medium

DOM text
is reinterpreted as HTML without escaping meta-characters.

Copilot Autofix

AI 11 days ago

To fix the issue, the code should avoid using the xmp tag entirely and instead ensure that the content is safely encoded before adding it to the DOM. Specifically:

  1. Use textContent instead of innerHTML to prevent any interpretation of HTML.
  2. Replace the conditional branch that uses the xmp tag with a safe alternative that ensures the raw code is displayed without escaping it as HTML.

Suggested changeset 1
src/js/services/manage/cloud.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/js/services/manage/cloud.ts b/src/js/services/manage/cloud.ts
--- a/src/js/services/manage/cloud.ts
+++ b/src/js/services/manage/cloud.ts
@@ -29,7 +29,7 @@
 			snippetCodeModalTag.textContent = snippetCodeInput.value
 
 			if ('markup' === snippetLanguage) {
-				snippetCodeModalTag.innerHTML = `<xmp>${snippetCodeInput.value}</xmp>`
+				snippetCodeModalTag.textContent = snippetCodeInput.value
 			}
 
 			if ('php' === snippetLanguage) {
EOF
@@ -29,7 +29,7 @@
snippetCodeModalTag.textContent = snippetCodeInput.value

if ('markup' === snippetLanguage) {
snippetCodeModalTag.innerHTML = `<xmp>${snippetCodeInput.value}</xmp>`
snippetCodeModalTag.textContent = snippetCodeInput.value
}

if ('php' === snippetLanguage) {
Copilot is powered by AI and may make mistakes. Always verify output.
@imantsk imantsk merged commit 5d2e2d0 into feat/wp-playground Jul 10, 2025
2 checks passed
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.

8 participants