Skip to content

Commit

Permalink
Merge pull request #25 from hyphacoop/profile-summary
Browse files Browse the repository at this point in the history
fix: use .innerHTML with DOMPurify for profile summary to prevent raw html display
  • Loading branch information
RangerMauve authored Jul 29, 2024
2 parents d53bd9f + 44bd32d commit 19517ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion actor-profile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { db } from './dbInstance.js'
import DOMPurify from './dependencies/dompurify/purify.js'

class ActorProfile extends HTMLElement {
static get observedAttributes () {
Expand Down Expand Up @@ -96,7 +97,7 @@ class ActorProfile extends HTMLElement {
if (actorInfo.summary) {
const pUserSummary = document.createElement('div')
pUserSummary.classList.add('profile-summary')
pUserSummary.textContent = `${actorInfo.summary}`
pUserSummary.innerHTML = DOMPurify.sanitize(actorInfo.summary)
actorContainer.appendChild(pUserSummary) // Append to the actor container
}

Expand Down

0 comments on commit 19517ec

Please sign in to comment.