diff options
author | Chocobozzz <me@florianbigard.com> | 2023-02-27 09:44:03 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-02-27 09:44:03 +0100 |
commit | d7ce9dca613d96889baa0c93063806268f68cce5 (patch) | |
tree | ba453ee3ff972b8838ff94006bfae9a3e1123a59 /server/helpers/custom-validators | |
parent | 4765348107ddd21cd2a0b86093859aa2e23ac0f1 (diff) | |
download | PeerTube-d7ce9dca613d96889baa0c93063806268f68cce5.tar.gz PeerTube-d7ce9dca613d96889baa0c93063806268f68cce5.tar.zst PeerTube-d7ce9dca613d96889baa0c93063806268f68cce5.zip |
Add additional check for playlistName
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r-- | server/helpers/custom-validators/misc.ts | 5 |
1 files changed, 5 insertions, 0 deletions
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) { | |||
15 | }) | 15 | }) |
16 | } | 16 | } |
17 | 17 | ||
18 | function isSafePeerTubeFilenameWithoutExtension (filename: string) { | ||
19 | return filename.match(/^[a-z0-9-]+$/) | ||
20 | } | ||
21 | |||
18 | function isArray (value: any): value is any[] { | 22 | function isArray (value: any): value is any[] { |
19 | return Array.isArray(value) | 23 | return Array.isArray(value) |
20 | } | 24 | } |
@@ -172,5 +176,6 @@ export { | |||
172 | areUUIDsValid, | 176 | areUUIDsValid, |
173 | toIntArray, | 177 | toIntArray, |
174 | isFileValid, | 178 | isFileValid, |
179 | isSafePeerTubeFilenameWithoutExtension, | ||
175 | checkMimetypeRegex | 180 | checkMimetypeRegex |
176 | } | 181 | } |