Fix server sanitizer to allow books/recommended placements and linkUrl/linkLabel fields; v1.1.38

- Add 'books' and 'recommended' to the placement whitelist in sanitizeCustomLinks
- Allow items with no url when placement is books/recommended (they use amazonUrl)
- Preserve linkUrl and linkLabel through sanitizeCustomBlocks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmert
2026-08-26 08:23:59 -04:00
parent eb1d3ddd9c
commit 889baf23ca
+5 -1
View File
@@ -167,6 +167,8 @@ function sanitizeCustomLinks(value) {
|| item?.placement === 'resources'
|| item?.placement === 'otherSites'
|| item?.placement === 'externalSites'
|| item?.placement === 'books'
|| item?.placement === 'recommended'
? item.placement
: 'footer'
@@ -184,7 +186,7 @@ function sanitizeCustomLinks(value) {
placement,
}
})
.filter(item => item.label && item.url)
.filter(item => item.label && (item.url || item.amazonUrl || item.placement === 'books' || item.placement === 'recommended'))
}
function sanitizeCustomBlocks(value) {
@@ -198,6 +200,8 @@ function sanitizeCustomBlocks(value) {
page: item?.page === 'homepage' || item?.page === 'start-here' || item?.page === 'episodes' || item?.page === 'downloads' || item?.page === 'about' || item?.page === 'contact' || item?.page === 'questions'
? item.page
: 'downloads',
linkUrl: sanitizeUrl(item.linkUrl),
linkLabel: typeof item.linkLabel === 'string' ? item.linkLabel.trim().slice(0, 120) : '',
}))
.filter(item => item.heading || item.body)
}