diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index 7b4ef595..32e2cf34 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -3138,11 +3138,12 @@ class TicketController extends BaseController ], 'url.*' => [ 'label' => 'URL', - 'rules' => 'required', + 'rules' => 'if_exist|required|regex_match[/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/]', 'errors' => [ - 'required' => 'URL is required', + 'required' => 'URL is required.', + 'regex_match' => 'The URL format is invalid. Example: www.google.com or https://google.com' ] - ] + ], ]; if (!$this->validate($rules)) {