From 81711939d177924266bf988278f93bed046c9798 Mon Sep 17 00:00:00 2001 From: Simon Green Date: Fri, 7 Oct 2016 10:29:48 +1300 Subject: Bug 1290588 - Group Administration via interface should error if regular expression size is greater than column length --- Bugzilla/Group.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Bugzilla/Group.pm') diff --git a/Bugzilla/Group.pm b/Bugzilla/Group.pm index 61c085c0e..481987488 100644 --- a/Bugzilla/Group.pm +++ b/Bugzilla/Group.pm @@ -482,6 +482,12 @@ sub _check_description { sub _check_user_regexp { my ($invocant, $regex) = @_; $regex = trim($regex) || ''; + + my $max_length = Bugzilla->dbh->bz_column_length( 'groups', 'userregexp' ); + ThrowUserError( "group_regexp_too_long", + { text => $regex, max_length => $max_length } ) + if length($regex) > $max_length; + ThrowUserError("invalid_regexp") unless (eval {qr/$regex/}); return $regex; } -- cgit v1.2.3-24-g4f1b