From 5ca836048d4f3319d24d2d4580912102eed54618 Mon Sep 17 00:00:00 2001 From: Ariejan de Vroom Date: Mon, 26 Dec 2011 10:12:09 +0100 Subject: [PATCH] Use URI::regexp for validating WebHook urls --- app/models/web_hook.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/web_hook.rb b/app/models/web_hook.rb index 96684d15f8a..0058bd57b91 100644 --- a/app/models/web_hook.rb +++ b/app/models/web_hook.rb @@ -9,7 +9,7 @@ class WebHook < ActiveRecord::Base validates :url, presence: true, format: { - with: /(^$)|(^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$)/ix, + with: URI::regexp(%w(http https)), message: "should be a valid url" } def execute(data)