mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-31 03:08:29 +08:00
escaping html
This commit is contained in:
parent
310db63597
commit
1e22daea1c
1 changed files with 10 additions and 2 deletions
|
|
@ -135,14 +135,22 @@ export async function update(
|
|||
const git = profile.details?.socialProfiles.github;
|
||||
if (git) {
|
||||
socialsEl.append(
|
||||
`<a href='https://github.com/${git}/' target="_blank" aria-label="${git}" data-balloon-pos="up"><i class="fab fa-fw fa-github"></i></a>`
|
||||
`<a href='https://github.com/${Misc.escapeHTML(
|
||||
git
|
||||
)}/' target="_blank" aria-label="${Misc.escapeHTML(
|
||||
git
|
||||
)}" data-balloon-pos="up"><i class="fab fa-fw fa-github"></i></a>`
|
||||
);
|
||||
}
|
||||
|
||||
const twitter = profile.details?.socialProfiles.twitter;
|
||||
if (twitter) {
|
||||
socialsEl.append(
|
||||
`<a href='https://twitter.com/${twitter}' target="_blank" aria-label="${twitter}" data-balloon-pos="up"><i class="fab fa-fw fa-twitter"></i></a>`
|
||||
`<a href='https://twitter.com/${Misc.escapeHTML(
|
||||
twitter
|
||||
)}' target="_blank" aria-label="${Misc.escapeHTML(
|
||||
twitter
|
||||
)}" data-balloon-pos="up"><i class="fab fa-fw fa-twitter"></i></a>`
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue