diff options
author | Simon Green <mail@simon.green> | 2016-10-06 23:29:48 +0200 |
---|---|---|
committer | Simon Green <mail@simon.green> | 2016-10-06 23:29:48 +0200 |
commit | 81711939d177924266bf988278f93bed046c9798 (patch) | |
tree | d6c53815c9c72446c40e3079448f994bac901b86 /Bugzilla/Group.pm | |
parent | 63f79c626077c29a0134a2e3a97d6fe0665e7200 (diff) | |
download | bugzilla-81711939d177924266bf988278f93bed046c9798.tar.gz bugzilla-81711939d177924266bf988278f93bed046c9798.tar.xz |
Bug 1290588 - Group Administration via interface should error if regular expression size is greater than column length
Diffstat (limited to 'Bugzilla/Group.pm')
-rw-r--r-- | Bugzilla/Group.pm | 6 |
1 files changed, 6 insertions, 0 deletions
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; } |