mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
fix missing title attribute on <iframe> tag suggested for embedding (#3901)
* title attribute is missing on <iframe> tag suggested for embedding #3861 * fix #3901 * fix: escapeHTML #3901 * fix: playlist title instead of video title #3901 * fix #3901 * assign title directly #3901
This commit is contained in:
parent
47099aba46
commit
4097c6d66c
13 changed files with 48 additions and 35 deletions
|
@ -19,3 +19,21 @@ export const SANITIZE_OPTIONS = {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Thanks: https://stackoverflow.com/a/12034334
|
||||
export function escapeHTML (stringParam: string) {
|
||||
if (!stringParam) return ''
|
||||
|
||||
const entityMap = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
'\'': ''',
|
||||
'/': '/',
|
||||
'`': '`',
|
||||
'=': '='
|
||||
}
|
||||
|
||||
return String(stringParam).replace(/[&<>"'`=/]/g, s => entityMap[s])
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue