Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions backend/src/entities/shared-jobs/shared-jobs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,11 @@ export class SharedJobsService {
}

private isValueTelephoneNumber(value: unknown): boolean {
return ValidationHelper.isValidPhoneNumber(String(value));
if (typeof value !== 'string') {
return false;
}
const phoneRegex = /^\+\d{10,}$/;
return phoneRegex.test(value) && ValidationHelper.isValidPhoneNumber(value);
}

private isValueRgbColor(value: unknown): boolean {
Expand Down Expand Up @@ -271,7 +275,8 @@ export class SharedJobsService {
if (typeof value !== 'string') {
return false;
}
return ValidationHelper.isValidUrl(value);
const urlRegex = /^https?:\/\/.+/;
return urlRegex.test(value) && ValidationHelper.isValidUrl(value);
}

private isValueJSON(value: unknown): boolean {
Expand Down