Commit 4d9a1326 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 157092: Implement a checking mechanism for invalid regexp (Fix the Oracle driver)

Patch By Xiaoou Wu <xiaoou.wu@oracle.com> r=mkanat, a=mkanat
parent 50be2386
......@@ -94,6 +94,16 @@ sub bz_last_key {
return $last_insert_id;
}
sub bz_check_regexp {
my ($self, $pattern) = @_;
eval { $self->do("SELECT 1 FROM DUAL WHERE "
. $self->sql_regexp($self->quote("a"), $self->quote($pattern), 1)) };
$@ && ThrowUserError('illegal_regexp',
{ value => $pattern, dberror => $self->errstr });
}
sub sql_regexp {
my ($self, $expr, $pattern, $nocheck) = @_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment