diff options
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/forms/form-validators/host.validator.ts | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/client/src/app/shared/forms/form-validators/host.validator.ts b/client/src/app/shared/forms/form-validators/host.validator.ts index 03e810fdb..c18a35f9b 100644 --- a/client/src/app/shared/forms/form-validators/host.validator.ts +++ b/client/src/app/shared/forms/form-validators/host.validator.ts | |||
@@ -1,14 +1,8 @@ | |||
1 | import { FormControl } from '@angular/forms' | 1 | export function validateHost (value: string) { |
2 | |||
3 | export function validateHost (c: FormControl) { | ||
4 | // Thanks to http://stackoverflow.com/a/106223 | 2 | // Thanks to http://stackoverflow.com/a/106223 |
5 | const HOST_REGEXP = new RegExp( | 3 | const HOST_REGEXP = new RegExp( |
6 | '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$' | 4 | '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$' |
7 | ) | 5 | ) |
8 | 6 | ||
9 | return HOST_REGEXP.test(c.value) ? null : { | 7 | return HOST_REGEXP.test(value) |
10 | validateHost: { | ||
11 | valid: false | ||
12 | } | ||
13 | } | ||
14 | } | 8 | } |