Skip to content

Commit ffc11d8

Browse files
Eli MenschEli Mensch
authored andcommitted
fix: Secure social link display
1 parent d61dff1 commit ffc11d8

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "c2pa-wc",
5+
"comment": "Secure social link display",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "c2pa-wc"
10+
}

packages/c2pa-wc/src/components/SocialMedia/SocialMedia.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,21 @@ export class SocialMedia extends Localizable(LitElement) {
7272
>
7373
<div slot="header">${this.strings['social-media.header']}</div>
7474
<ul class="section-social-media-list" slot="content">
75-
${this.data?.map(
76-
(socialAccount) => html`
77-
<li class="section-social-media-list-item">
78-
<a
79-
class="section-social-media-list-item-link"
80-
href=${socialAccount['@id']}
81-
target="_blank"
82-
>
83-
<cai-icon source="${socialAccount['@id']}"></cai-icon>
84-
</a>
85-
</li>
86-
`,
87-
)}
75+
${this.data
76+
?.filter((account) => account['@id']?.startsWith('http'))
77+
.map(
78+
(socialAccount) => html`
79+
<li class="section-social-media-list-item">
80+
<a
81+
class="section-social-media-list-item-link"
82+
href=${socialAccount['@id']}
83+
target="_blank"
84+
>
85+
<cai-icon source="${socialAccount['@id']}"></cai-icon>
86+
</a>
87+
</li>
88+
`,
89+
)}
8890
</ul>
8991
</cai-panel-section>`;
9092
}

0 commit comments

Comments
 (0)