mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +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
|
@ -1,9 +1,10 @@
|
|||
import { Response } from 'express'
|
||||
import { AbuseModel } from '@server/models/abuse/abuse'
|
||||
import { HttpStatusCode } from '@shared/models'
|
||||
import { forceNumber } from '@shared/core-utils'
|
||||
|
||||
async function doesAbuseExist (abuseId: number | string, res: Response) {
|
||||
const abuse = await AbuseModel.loadByIdWithReporter(parseInt(abuseId + '', 10))
|
||||
const abuse = await AbuseModel.loadByIdWithReporter(forceNumber(abuseId))
|
||||
|
||||
if (!abuse) {
|
||||
res.fail({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue