diff options
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r-- | server/helpers/custom-validators/activitypub/misc.ts | 4 | ||||
-rw-r--r-- | server/helpers/custom-validators/videos.ts | 3 |
2 files changed, 1 insertions, 6 deletions
diff --git a/server/helpers/custom-validators/activitypub/misc.ts b/server/helpers/custom-validators/activitypub/misc.ts index 2dac8e1ad..6c5c7abca 100644 --- a/server/helpers/custom-validators/activitypub/misc.ts +++ b/server/helpers/custom-validators/activitypub/misc.ts | |||
@@ -41,12 +41,10 @@ function setValidAttributedTo (obj: any) { | |||
41 | return true | 41 | return true |
42 | } | 42 | } |
43 | 43 | ||
44 | const newAttributesTo = obj.attributedTo.filter(a => { | 44 | obj.attributedTo = obj.attributedTo.filter(a => { |
45 | return (a.type === 'Group' || a.type === 'Person') && isActivityPubUrlValid(a.id) | 45 | return (a.type === 'Group' || a.type === 'Person') && isActivityPubUrlValid(a.id) |
46 | }) | 46 | }) |
47 | 47 | ||
48 | obj.attributedTo = newAttributesTo | ||
49 | |||
50 | return true | 48 | return true |
51 | } | 49 | } |
52 | 50 | ||
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index 5e6cfe217..4b1f6c069 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts | |||
@@ -6,7 +6,6 @@ import * as validator from 'validator' | |||
6 | import { UserRight, VideoPrivacy, VideoRateType } from '../../../shared' | 6 | import { UserRight, VideoPrivacy, VideoRateType } from '../../../shared' |
7 | import { | 7 | import { |
8 | CONSTRAINTS_FIELDS, | 8 | CONSTRAINTS_FIELDS, |
9 | VIDEO_ABUSE_STATES, | ||
10 | VIDEO_CATEGORIES, | 9 | VIDEO_CATEGORIES, |
11 | VIDEO_LICENCES, | 10 | VIDEO_LICENCES, |
12 | VIDEO_MIMETYPE_EXT, | 11 | VIDEO_MIMETYPE_EXT, |
@@ -19,10 +18,8 @@ import { exists, isArray, isFileValid } from './misc' | |||
19 | import { VideoChannelModel } from '../../models/video/video-channel' | 18 | import { VideoChannelModel } from '../../models/video/video-channel' |
20 | import { UserModel } from '../../models/account/user' | 19 | import { UserModel } from '../../models/account/user' |
21 | import * as magnetUtil from 'magnet-uri' | 20 | import * as magnetUtil from 'magnet-uri' |
22 | import { VideoAbuseModel } from '../../models/video/video-abuse' | ||
23 | 21 | ||
24 | const VIDEOS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEOS | 22 | const VIDEOS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEOS |
25 | const VIDEO_ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_ABUSES | ||
26 | 23 | ||
27 | function isVideoCategoryValid (value: any) { | 24 | function isVideoCategoryValid (value: any) { |
28 | return value === null || VIDEO_CATEGORIES[ value ] !== undefined | 25 | return value === null || VIDEO_CATEGORIES[ value ] !== undefined |