diff options
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r-- | Bugzilla/DB.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index 1617b7fc2..2eba30482 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -383,6 +383,15 @@ sub bz_last_key { $table, $column); } +sub bz_check_regexp { + my ($self, $pattern) = @_; + + eval { $self->do("SELECT " . $self->sql_regexp($self->quote("a"), $pattern, 1)) }; + + $@ && ThrowUserError('illegal_regexp', + { value => $pattern, dberror => $self->errstr }); +} + ##################################################################### # Database Setup ##################################################################### |