Beta: TOTP 2FA, admin asset manager, resource page redesign, rate limiting, and security hardening
This commit is contained in:
@@ -171,6 +171,7 @@ function sanitizeCustomLinks(value) {
|
||||
label: typeof item.label === 'string' ? item.label.trim().slice(0, 140) : '',
|
||||
url: sanitizeUrl(item.url),
|
||||
imageUrl: sanitizeUrl(item.imageUrl),
|
||||
description: typeof item.description === 'string' ? item.description.trim().slice(0, 400) : '',
|
||||
placement,
|
||||
}
|
||||
})
|
||||
@@ -196,6 +197,7 @@ function sanitizeArchivedSeriesResourceLinks(value) {
|
||||
.map(item => ({
|
||||
id: typeof item.id === 'string' && item.id.trim() ? item.id.trim() : randomUUID(),
|
||||
label: typeof item.label === 'string' ? item.label.trim().slice(0, 120) : '',
|
||||
description: typeof item.description === 'string' ? item.description.trim().slice(0, 400) : '',
|
||||
url: sanitizeUrl(item.url),
|
||||
}))
|
||||
.filter(item => item.label && item.url)
|
||||
@@ -334,6 +336,9 @@ export function inferImageExtensionFromDataUrl(dataUrl) {
|
||||
if (dataUrl.startsWith('data:image/jpeg;base64,')) return '.jpg'
|
||||
if (dataUrl.startsWith('data:image/webp;base64,')) return '.webp'
|
||||
if (dataUrl.startsWith('data:image/gif;base64,')) return '.gif'
|
||||
if (dataUrl.startsWith('data:application/pdf;base64,')) return '.pdf'
|
||||
if (dataUrl.startsWith('data:application/msword;base64,')) return '.doc'
|
||||
if (dataUrl.startsWith('data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,')) return '.docx'
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user