1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Add additional check for playlistName

This commit is contained in:
Chocobozzz 2023-02-27 09:44:03 +01:00
parent 4765348107
commit d7ce9dca61
No known key found for this signature in database
GPG key ID: 583A612D890159BE
2 changed files with 10 additions and 1 deletions

View file

@ -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
}