You've already forked AstralRinth
forked from didirus/AstralRinth
@@ -68,6 +68,10 @@ export const configuredXss = new xss.FilterXSS({
|
|||||||
try {
|
try {
|
||||||
const url = new URL(value)
|
const url = new URL(value)
|
||||||
|
|
||||||
|
if (url.hostname.includes('wsrv.nl')) {
|
||||||
|
url.searchParams.delete('errorredirect')
|
||||||
|
}
|
||||||
|
|
||||||
const allowedHostnames = [
|
const allowedHostnames = [
|
||||||
'imgur.com',
|
'imgur.com',
|
||||||
'i.imgur.com',
|
'i.imgur.com',
|
||||||
@@ -88,9 +92,11 @@ export const configuredXss = new xss.FilterXSS({
|
|||||||
return xss.safeAttrValue(
|
return xss.safeAttrValue(
|
||||||
tag,
|
tag,
|
||||||
name,
|
name,
|
||||||
`https://wsrv.nl/?url=${encodeURIComponent(value)}&n=-1`,
|
`https://wsrv.nl/?url=${encodeURIComponent(url.toString())}&n=-1`,
|
||||||
cssFilter
|
cssFilter
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
return xss.safeAttrValue(tag, name, url.toString(), cssFilter)
|
||||||
}
|
}
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user