diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-18 16:25:37 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-18 16:25:37 +0100 |
commit | 4ddcb7c3bad4e98d05d25298f7f11353a639b360 (patch) | |
tree | 85f90d3cee33d779c755037ee98f5c22a6bc323c /client/src/app | |
parent | 4aaee17f337724931784c7d41c8181642e77a028 (diff) | |
download | PeerTube-4ddcb7c3bad4e98d05d25298f7f11353a639b360.tar.gz PeerTube-4ddcb7c3bad4e98d05d25298f7f11353a639b360.tar.zst PeerTube-4ddcb7c3bad4e98d05d25298f7f11353a639b360.zip |
Fix video tag validator
Diffstat (limited to 'client/src/app')
-rw-r--r-- | client/src/app/shared/form-validators/video-validators.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/src/app/shared/form-validators/video-validators.ts b/client/src/app/shared/form-validators/video-validators.ts index 23f2391b2..b3ce876b1 100644 --- a/client/src/app/shared/form-validators/video-validators.ts +++ b/client/src/app/shared/form-validators/video-validators.ts | |||
@@ -64,7 +64,7 @@ export const VIDEO_TAGS_ARRAY_VALIDATOR: BuildFormValidator = { | |||
64 | VALIDATORS: [ Validators.maxLength(5), arrayTagLengthValidator() ], | 64 | VALIDATORS: [ Validators.maxLength(5), arrayTagLengthValidator() ], |
65 | MESSAGES: { | 65 | MESSAGES: { |
66 | 'maxlength': $localize`A maximum of 5 tags can be used on a video.`, | 66 | 'maxlength': $localize`A maximum of 5 tags can be used on a video.`, |
67 | 'arrayTagLength': $localize`A tag should be more than 2, and less than 30 characters long.` | 67 | 'arrayTagLength': $localize`A tag should be more than 1 and less than 30 characters long.` |
68 | } | 68 | } |
69 | } | 69 | } |
70 | 70 | ||
@@ -92,7 +92,7 @@ function arrayTagLengthValidator (min = 2, max = 30): ValidatorFn { | |||
92 | return (control: AbstractControl): ValidationErrors => { | 92 | return (control: AbstractControl): ValidationErrors => { |
93 | const array = control.value as Array<string> | 93 | const array = control.value as Array<string> |
94 | 94 | ||
95 | if (array.every(e => e.length > min && e.length < max)) { | 95 | if (array.every(e => e.length >= min && e.length <= max)) { |
96 | return null | 96 | return null |
97 | } | 97 | } |
98 | 98 | ||