Girocco::Util: Accept web URLs with port number
authorJan Krüger <jk@jk.gs>
Wed, 28 Mar 2012 08:53:17 +0000 (28 10:53 +0200)
committerJan Krüger <jk@jk.gs>
Wed, 28 Mar 2012 08:53:17 +0000 (28 10:53 +0200)
There's really no reason to reject URLs with an alternative port and it
can be especially useful for stuff like JSON notify URLs when someone
wants to directly notify a specialised HTTP server.

Girocco/Util.pm

index fe125ea..78fceab 100644 (file)
@@ -107,7 +107,7 @@ sub valid_email_multi {
 }
 sub valid_web_url {
        $_ = $_[0];
-       /^https?:\/\/[a-zA-Z0-9-.]+(\/[_\%a-zA-Z0-9.\/~:?&=;-]*)?(#[a-zA-Z0-9._-]+)?$/;
+       /^https?:\/\/[a-zA-Z0-9-.:]+(\/[_\%a-zA-Z0-9.\/~:?&=;-]*)?(#[a-zA-Z0-9._-]+)?$/;
 }
 sub valid_repo_url {
        $_ = $_[0];