1
0

fix: trim author size duh

This commit is contained in:
dusk 2024-08-24 16:21:09 +03:00
parent aee545c963
commit dfeda15cd6
Signed by: dusk
SSH Key Fingerprint: SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw

View File

@ -25,7 +25,7 @@ const scopeCookies = (cookies: Cookies) => {
const postAction = (client: any, scopes: string[]) => { const postAction = (client: any, scopes: string[]) => {
return async ({ request, cookies }: { request: Request, cookies: Cookies }) => { return async ({ request, cookies }: { request: Request, cookies: Cookies }) => {
const form = await request.formData() const form = await request.formData()
const author = form.get("author")?.toString().replace(/([^_a-z0-9]+)/gi, '') const author = form.get("author")?.toString().substring(0, 32).replace(/([^_a-z0-9]+)/gi, '')
const content = form.get("content")?.toString().substring(0, 512) const content = form.get("content")?.toString().substring(0, 512)
const scopedCookies = scopeCookies(cookies) const scopedCookies = scopeCookies(cookies)
if (author === undefined || content === undefined) { if (author === undefined || content === undefined) {