summaryrefslogtreecommitdiffstats
path: root/showdependencytree.cgi
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-06-30 04:57:54 +0200
committermkanat%bugzilla.org <>2008-06-30 04:57:54 +0200
commitc1ca86053ed276aa05eac8468cea61785629ac5e (patch)
tree836d5cae869dc47008b16bccb1de47320a36fcc8 /showdependencytree.cgi
parent9ed763d945ffe2a468871d4731f3bd001caab21c (diff)
downloadbugzilla-c1ca86053ed276aa05eac8468cea61785629ac5e.tar.gz
bugzilla-c1ca86053ed276aa05eac8468cea61785629ac5e.tar.xz
Bug 440612 – Use Bugzilla::Bug->check everywhere instead of ValidateBugID
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'showdependencytree.cgi')
-rwxr-xr-xshowdependencytree.cgi9
1 files changed, 4 insertions, 5 deletions
diff --git a/showdependencytree.cgi b/showdependencytree.cgi
index 80e67716a..8683c190c 100755
--- a/showdependencytree.cgi
+++ b/showdependencytree.cgi
@@ -49,9 +49,8 @@ my $dbh = Bugzilla->switch_to_shadow_db();
# Make sure the bug ID is a positive integer representing an existing
# bug that the user is authorized to access.
-my $id = $cgi->param('id') || ThrowUserError('improper_bug_id_field_value');
-ValidateBugID($id);
-my $current_bug = new Bugzilla::Bug($id);
+my $bug = Bugzilla::Bug->check(scalar $cgi->param('id'));
+my $id = $bug->id;
local our $hide_resolved = $cgi->param('hide_resolved') ? 1 : 0;
@@ -67,7 +66,7 @@ local our $realdepth = 0;
# Generate the tree of bugs that this bug depends on and a list of IDs
# appearing in the tree.
-my $dependson_tree = { $id => $current_bug };
+my $dependson_tree = { $id => $bug };
my $dependson_ids = {};
GenerateTree($id, "dependson", 1, $dependson_tree, $dependson_ids);
$vars->{'dependson_tree'} = $dependson_tree;
@@ -75,7 +74,7 @@ $vars->{'dependson_ids'} = [keys(%$dependson_ids)];
# Generate the tree of bugs that this bug blocks and a list of IDs
# appearing in the tree.
-my $blocked_tree = { $id => $current_bug };
+my $blocked_tree = { $id => $bug };
my $blocked_ids = {};
GenerateTree($id, "blocked", 1, $blocked_tree, $blocked_ids);
$vars->{'blocked_tree'} = $blocked_tree;