From d7ce9dca613d96889baa0c93063806268f68cce5 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 27 Feb 2023 09:44:03 +0100 Subject: Add additional check for playlistName --- server/helpers/custom-validators/misc.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'server/helpers/custom-validators') diff --git a/server/helpers/custom-validators/misc.ts b/server/helpers/custom-validators/misc.ts index b3ab3ac64..ebab4c6b2 100644 --- a/server/helpers/custom-validators/misc.ts +++ b/server/helpers/custom-validators/misc.ts @@ -15,6 +15,10 @@ function isSafePath (p: string) { }) } +function isSafePeerTubeFilenameWithoutExtension (filename: string) { + return filename.match(/^[a-z0-9-]+$/) +} + function isArray (value: any): value is any[] { return Array.isArray(value) } @@ -172,5 +176,6 @@ export { areUUIDsValid, toIntArray, isFileValid, + isSafePeerTubeFilenameWithoutExtension, checkMimetypeRegex } -- cgit v1.2.3