Skip to content

Comments

Replace use of XSS-prone innerHTML with safe textContent#14476

Merged
teoli2003 merged 1 commit intomdn:mainfrom
wooorm:patch-1
Mar 30, 2022
Merged

Replace use of XSS-prone innerHTML with safe textContent#14476
teoli2003 merged 1 commit intomdn:mainfrom
wooorm:patch-1

Conversation

@wooorm
Copy link
Contributor

@wooorm wooorm commented Mar 30, 2022

Summary

This change is equivalent. However, it replaces an XSS-prone API (innerHTML) with a safe API (textContent)

Motivation

To encourage good web citizenship :)

Supporting details

Related issues

Metadata

  • Adds a new document
  • Rewrites (or significantly expands) a document
  • Fixes a typo, bug, or other error

@wooorm wooorm requested a review from a team as a code owner March 30, 2022 16:29
@wooorm wooorm requested review from sideshowbarker and removed request for a team March 30, 2022 16:29
@github-actions github-actions bot added the Content:WebAPI Web API docs label Mar 30, 2022
@github-actions
Copy link
Contributor

Preview URLs

Flaws

URL: /en-US/docs/Web/API/DocumentFragment
Title: DocumentFragment
on GitHub
Flaw count: 2

  • macros:
    • wrong xref macro used (consider changing which macro you use)
    • /en-US/docs/Web/API/DocumentFragment/getElementById does not exist

External URLs

URL: /en-US/docs/Web/API/DocumentFragment
Title: DocumentFragment
on GitHub

No new external URLs

Copy link
Contributor

@teoli2003 teoli2003 left a comment

Choose a reason for hiding this comment

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

Thank you! Good catch!

@teoli2003 teoli2003 merged commit a3f6647 into mdn:main Mar 30, 2022
@teoli2003
Copy link
Contributor

Thanks a lot!

Looks good to me.

Congratulations upon your first merged commit here! Welcome aboard! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants