mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
fix(api): 🐛 Enforce emoji shortcode filters
This commit is contained in:
parent
9eac364e01
commit
c737aeba8e
|
|
@ -113,9 +113,15 @@ export default apiRoute((app) => {
|
|||
"json",
|
||||
z
|
||||
.object({
|
||||
shortcode: CustomEmojiSchema.shape.shortcode.max(
|
||||
config.validation.emojis.max_shortcode_characters,
|
||||
),
|
||||
shortcode: CustomEmojiSchema.shape.shortcode
|
||||
.max(config.validation.emojis.max_shortcode_characters)
|
||||
.refine(
|
||||
(s) =>
|
||||
!config.validation.filters.emoji_shortcode.some(
|
||||
(filter) => filter.test(s),
|
||||
),
|
||||
"Shortcode contains blocked words",
|
||||
),
|
||||
element: z
|
||||
.string()
|
||||
.url()
|
||||
|
|
|
|||
|
|
@ -45,9 +45,15 @@ export default apiRoute((app) =>
|
|||
validator(
|
||||
"json",
|
||||
z.object({
|
||||
shortcode: CustomEmojiSchema.shape.shortcode.max(
|
||||
config.validation.emojis.max_shortcode_characters,
|
||||
),
|
||||
shortcode: CustomEmojiSchema.shape.shortcode
|
||||
.max(config.validation.emojis.max_shortcode_characters)
|
||||
.refine(
|
||||
(s) =>
|
||||
!config.validation.filters.emoji_shortcode.some(
|
||||
(filter) => filter.test(s),
|
||||
),
|
||||
"Shortcode contains blocked words",
|
||||
),
|
||||
element: z
|
||||
.string()
|
||||
.url()
|
||||
|
|
|
|||
Loading…
Reference in a new issue