diff options
author | Chocobozzz <me@florianbigard.com> | 2023-04-21 14:55:10 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-05-09 08:57:34 +0200 |
commit | 0c9668f77901e7540e2c7045eb0f2974a4842a69 (patch) | |
tree | 226d3dd1565b0bb56588897af3b8530e6216e96b /server/helpers/custom-validators/misc.ts | |
parent | 6bcb854cdea8688a32240bc5719c7d139806e00b (diff) | |
download | PeerTube-0c9668f77901e7540e2c7045eb0f2974a4842a69.tar.gz PeerTube-0c9668f77901e7540e2c7045eb0f2974a4842a69.tar.zst PeerTube-0c9668f77901e7540e2c7045eb0f2974a4842a69.zip |
Implement remote runner jobs in server
Move ffmpeg functions to @shared
Diffstat (limited to 'server/helpers/custom-validators/misc.ts')
-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 ebab4c6b2..fa0f469f6 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 isSafeFilename (filename: string, extension: string) { | ||
19 | return typeof filename === 'string' && !!filename.match(new RegExp(`^[a-z0-9-]+\\.${extension}$`)) | ||
20 | } | ||
21 | |||
18 | function isSafePeerTubeFilenameWithoutExtension (filename: string) { | 22 | function isSafePeerTubeFilenameWithoutExtension (filename: string) { |
19 | return filename.match(/^[a-z0-9-]+$/) | 23 | return filename.match(/^[a-z0-9-]+$/) |
20 | } | 24 | } |
@@ -177,5 +181,6 @@ export { | |||
177 | toIntArray, | 181 | toIntArray, |
178 | isFileValid, | 182 | isFileValid, |
179 | isSafePeerTubeFilenameWithoutExtension, | 183 | isSafePeerTubeFilenameWithoutExtension, |
184 | isSafeFilename, | ||
180 | checkMimetypeRegex | 185 | checkMimetypeRegex |
181 | } | 186 | } |