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
2de6abfd
Commit
2de6abfd
authored
Aug 23, 2006
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 349558: Move validations of global enum fields from post_bug into Bugzilla::Bug
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=bkor, a=justdave
parent
57956546
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
8 deletions
+41
-8
Bug.pm
Bugzilla/Bug.pm
+32
-0
post_bug.cgi
post_bug.cgi
+9
-8
No files found.
Bugzilla/Bug.pm
View file @
2de6abfd
...
...
@@ -262,6 +262,13 @@ sub _check_bug_file_loc {
return
$url
;
}
sub
_check_bug_severity
{
my
(
$severity
)
=
@_
;
$severity
=
trim
(
$severity
);
check_field
(
'bug_severity'
,
$severity
);
return
$severity
;
}
sub
_check_bug_status
{
my
(
$status
,
$product
)
=
@_
;
my
$user
=
Bugzilla
->
user
;
...
...
@@ -363,6 +370,31 @@ sub _check_product {
return
$obj
;
}
sub
_check_op_sys
{
my
(
$op_sys
)
=
@_
;
$op_sys
=
trim
(
$op_sys
);
check_field
(
'op_sys'
,
$op_sys
);
return
$op_sys
;
}
sub
_check_priority
{
my
(
$priority
)
=
@_
;
if
(
!
Bugzilla
->
params
->
{
'letsubmitterchoosepriority'
})
{
$priority
=
Bugzilla
->
params
->
{
'defaultpriority'
};
}
$priority
=
trim
(
$priority
);
check_field
(
'priority'
,
$priority
);
return
$priority
;
}
sub
_check_rep_platform
{
my
(
$platform
)
=
@_
;
$platform
=
trim
(
$platform
);
check_field
(
'rep_platform'
,
$platform
);
return
$platform
;
}
sub
_check_short_desc
{
my
(
$short_desc
)
=
@_
;
# Set the parameter to itself, but cleaned up
...
...
post_bug.cgi
View file @
2de6abfd
...
...
@@ -191,15 +191,16 @@ if (!defined $cgi->param('target_milestone')) {
$cgi
->
param
(
-
name
=>
'target_milestone'
,
-
value
=>
$product
->
default_milestone
);
}
if
(
!
Bugzilla
->
params
->
{
'letsubmitterchoosepriority'
})
{
$cgi
->
param
(
-
name
=>
'priority'
,
-
value
=>
Bugzilla
->
params
->
{
'defaultpriority'
});
}
# Some more sanity checking
check_field
(
'rep_platform'
,
scalar
$cgi
->
param
(
'rep_platform'
));
check_field
(
'bug_severity'
,
scalar
$cgi
->
param
(
'bug_severity'
));
check_field
(
'priority'
,
scalar
$cgi
->
param
(
'priority'
));
check_field
(
'op_sys'
,
scalar
$cgi
->
param
(
'op_sys'
));
$cgi
->
param
(
-
name
=>
'priority'
,
-
value
=>
Bugzilla::Bug::
_check_priority
(
$cgi
->
param
(
'priority'
)));
$cgi
->
param
(
-
name
=>
'rep_platform'
,
-
value
=>
Bugzilla::Bug::
_check_rep_platform
(
$cgi
->
param
(
'rep_platform'
)));
$cgi
->
param
(
-
name
=>
'bug_severity'
,
-
value
=>
Bugzilla::Bug::
_check_bug_severity
(
$cgi
->
param
(
'bug_severity'
)));
$cgi
->
param
(
-
name
=>
'op_sys'
,
-
value
=>
Bugzilla::Bug::
_check_op_sys
(
$cgi
->
param
(
'op_sys'
)));
check_field
(
'version'
,
scalar
$cgi
->
param
(
'version'
),
[
map
(
$_
->
name
,
@
{
$product
->
versions
})]);
check_field
(
'target_milestone'
,
scalar
$cgi
->
param
(
'target_milestone'
),
...
...
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