From 811dc9f0764981a49ab9a5a61db862c30c78a917 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Thu, 4 Jul 2013 13:33:12 -0700 Subject: [PATCH] Util.pm: fix regexp [...] patterns containing '-' If the '-' is to be included in a bracket expression, it should either be escaped or be first or last. A range of [9-.] does not make sense. --- Girocco/Util.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Girocco/Util.pm b/Girocco/Util.pm index 5f11141..838c573 100644 --- a/Girocco/Util.pm +++ b/Girocco/Util.pm @@ -99,7 +99,7 @@ sub filedb_atomic_edit { sub valid_email { $_ = $_[0]; - /^[a-zA-Z0-9+._-]+@[a-zA-Z0-9-.]+$/; + /^[a-zA-Z0-9+._-]+@[a-zA-Z0-9.-]+$/; } sub valid_email_multi { $_ = $_[0]; @@ -108,11 +108,11 @@ 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]; - /^(https?|git|svn(\+http)?|svn(\+https)?|darcs|bzr):\/\/[a-zA-Z0-9-.:]+(\/[_\%a-zA-Z0-9.\/~-]*)?$/; + /^(https?|git|svn(\+http)?|svn(\+https)?|darcs|bzr):\/\/[a-zA-Z0-9.:-]+(\/[_\%a-zA-Z0-9.\/~-]*)?$/; } -- 2.11.4.GIT