Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
c34003dc
Commit
c34003dc
authored
Jun 19, 2008
by
dkl%redhat.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 157092 â Implement a checking mechanism for invalid regexp
Patch by David Lawrence <dkl@redhat.com> - r/a=mkanat
parent
f575fab3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
6 deletions
+32
-6
DB.pm
Bugzilla/DB.pm
+9
-0
Mysql.pm
Bugzilla/DB/Mysql.pm
+6
-2
Oracle.pm
Bugzilla/DB/Oracle.pm
+6
-2
Pg.pm
Bugzilla/DB/Pg.pm
+6
-2
user-error.html.tmpl
template/en/default/global/user-error.html.tmpl
+5
-0
No files found.
Bugzilla/DB.pm
View file @
c34003dc
...
...
@@ -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
#####################################################################
...
...
Bugzilla/DB/Mysql.pm
View file @
c34003dc
...
...
@@ -104,13 +104,17 @@ sub bz_last_key {
}
sub
sql_regexp
{
my
(
$self
,
$expr
,
$pattern
)
=
@_
;
my
(
$self
,
$expr
,
$pattern
,
$nocheck
)
=
@_
;
$self
->
bz_check_regexp
(
$pattern
)
if
!
$nocheck
;
return
"$expr REGEXP $pattern"
;
}
sub
sql_not_regexp
{
my
(
$self
,
$expr
,
$pattern
)
=
@_
;
my
(
$self
,
$expr
,
$pattern
,
$nocheck
)
=
@_
;
$self
->
bz_check_regexp
(
$pattern
)
if
!
$nocheck
;
return
"$expr NOT REGEXP $pattern"
;
}
...
...
Bugzilla/DB/Oracle.pm
View file @
c34003dc
...
...
@@ -95,13 +95,17 @@ sub bz_last_key {
}
sub
sql_regexp
{
my
(
$self
,
$expr
,
$pattern
)
=
@_
;
my
(
$self
,
$expr
,
$pattern
,
$nocheck
)
=
@_
;
$self
->
bz_check_regexp
(
$pattern
)
if
!
$nocheck
;
return
"REGEXP_LIKE($expr, $pattern)"
;
}
sub
sql_not_regexp
{
my
(
$self
,
$expr
,
$pattern
)
=
@_
;
my
(
$self
,
$expr
,
$pattern
,
$nocheck
)
=
@_
;
$self
->
bz_check_regexp
(
$pattern
)
if
!
$nocheck
;
return
"NOT REGEXP_LIKE($expr, $pattern)"
}
...
...
Bugzilla/DB/Pg.pm
View file @
c34003dc
...
...
@@ -93,13 +93,17 @@ sub bz_last_key {
}
sub
sql_regexp
{
my
(
$self
,
$expr
,
$pattern
)
=
@_
;
my
(
$self
,
$expr
,
$pattern
,
$nocheck
)
=
@_
;
$self
->
bz_check_regexp
(
$pattern
)
if
!
$nocheck
;
return
"$expr ~* $pattern"
;
}
sub
sql_not_regexp
{
my
(
$self
,
$expr
,
$pattern
)
=
@_
;
my
(
$self
,
$expr
,
$pattern
,
$nocheck
)
=
@_
;
$self
->
bz_check_regexp
(
$pattern
)
if
!
$nocheck
;
return
"$expr !~* $pattern"
}
...
...
template/en/default/global/user-error.html.tmpl
View file @
c34003dc
...
...
@@ -783,6 +783,11 @@
[% IF format %]
Please use the format '<tt>[% format FILTER html %]</tt>'.
[% END %]
[% ELSIF error == "illegal_regexp" %]
[% title = "Illegal Regular Expression" %]
The regular expression you provided [% value FILTER html %] is not valid.
The error was: [% dberror FILTER html %].
[% ELSIF error == "insufficient_data_points" %]
[% docslinks = {'reporting.html' => 'Reporting'} %]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment