fix: Gifs in the project description are not working properly (#7076)

* fix: Gifs in the project description are not working properly
Fixes #3786

* prepr

---------

Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
Calum H.
2026-08-10 15:43:13 +00:00
committed by GitHub
co-authored by Prospector
parent 07bac8ffde
commit 8b2438aebb
+4 -10
View File
@@ -90,7 +90,7 @@ export const configuredXss = new FilterXSS({
!value.startsWith('data:')
) {
try {
const url = new URL(value)
const url = new URL(value.replaceAll('&amp;', '&'))
if (url.hostname.includes('wsrv.nl')) {
url.searchParams.delete('errorredirect')
@@ -124,16 +124,10 @@ export const configuredXss = new FilterXSS({
!allowedHostnames.includes(url.hostname) &&
!allowedHostnameSuffixes.some((suffix) => url.hostname.endsWith(suffix))
) {
return safeAttrValue(
tag,
name,
`https://wsrv.nl/?url=${encodeURIComponent(
url.toString().replaceAll('&amp;', '&'),
)}&n=-1`,
cssFilter,
)
const proxiedUrl = `https://wsrv.nl/?url=${encodeURIComponent(url.toString())}&n=-1`
return safeAttrValue(tag, name, proxiedUrl.replaceAll('&', '&amp;'), cssFilter)
}
return safeAttrValue(tag, name, url.toString(), cssFilter)
return safeAttrValue(tag, name, url.toString().replaceAll('&', '&amp;'), cssFilter)
} catch {
/* empty */
}