mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Don't inject untrusted input
Even if it's already checked in middlewares It's better to have safe modals too
This commit is contained in:
parent
6bcb559fc9
commit
4638cd713d
35 changed files with 101 additions and 63 deletions
|
@ -4,6 +4,7 @@ import { buildTaskFileFieldname } from '@server/lib/video-studio'
|
|||
import { VideoStudioTask } from '@shared/models'
|
||||
import { isArray } from './misc'
|
||||
import { isVideoFileMimeTypeValid, isVideoImageValid } from './videos'
|
||||
import { forceNumber } from '@shared/core-utils'
|
||||
|
||||
function isValidStudioTasksArray (tasks: any) {
|
||||
if (!isArray(tasks)) return false
|
||||
|
@ -24,7 +25,7 @@ function isStudioCutTaskValid (task: VideoStudioTask) {
|
|||
|
||||
if (!start || !end) return true
|
||||
|
||||
return parseInt(start + '') < parseInt(end + '')
|
||||
return forceNumber(start) < forceNumber(end)
|
||||
}
|
||||
|
||||
function isStudioTaskAddIntroOutroValid (task: VideoStudioTask, indice: number, files: Express.Multer.File[]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue