web: sanitize content
This commit is contained in:
parent
643add9177
commit
7954c75841
2 changed files with 5 additions and 5 deletions
|
@ -29,9 +29,9 @@ function format_content(ev, show_media) {
|
||||||
if (ev.kind === 7) {
|
if (ev.kind === 7) {
|
||||||
if (ev.content === "" || ev.content === "+")
|
if (ev.content === "" || ev.content === "+")
|
||||||
return "❤️"
|
return "❤️"
|
||||||
return sanitize(ev.content.trim())
|
return sanitize(ev.content.trim());
|
||||||
}
|
}
|
||||||
const content = ev.content.trim()
|
const content = sanitize(ev.content.trim());
|
||||||
const body = convert_quote_blocks(content, show_media)
|
const body = convert_quote_blocks(content, show_media)
|
||||||
let cw = get_content_warning(ev.tags)
|
let cw = get_content_warning(ev.tags)
|
||||||
if (cw !== null) {
|
if (cw !== null) {
|
||||||
|
|
|
@ -188,10 +188,10 @@ function fmt_since_str(current, previous) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sanitize(content) {
|
function sanitize(str) {
|
||||||
if (!content)
|
if (!str)
|
||||||
return ""
|
return ""
|
||||||
return content.replaceAll("<","<").replaceAll(">",">")
|
return str.replaceAll("<","<").replaceAll(">",">")
|
||||||
}
|
}
|
||||||
|
|
||||||
function robohash(str) {
|
function robohash(str) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue