From 0b7d9e7f772ee107d0cb1816d6c5cb679ae6e01a Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Wed, 9 Mar 2005 08:26:38 +0000 Subject: Bug 284975: Any code after Throw*Error is a dead code. Patch By Tomas Kopal r=LpSolit, a=myk --- createaccount.cgi | 1 - editclassifications.cgi | 2 +- editcomponents.cgi | 17 ----------------- editkeywords.cgi | 6 ------ editmilestones.cgi | 12 ------------ editproducts.cgi | 2 -- editversions.cgi | 8 -------- 7 files changed, 1 insertion(+), 47 deletions(-) diff --git a/createaccount.cgi b/createaccount.cgi index 60a180623..de8dc6fde 100755 --- a/createaccount.cgi +++ b/createaccount.cgi @@ -72,7 +72,6 @@ if (defined($login)) { if (!($createexp) || ($login !~ /$createexp/)) { ThrowUserError("account_creation_disabled"); - exit; } # Create account diff --git a/editclassifications.cgi b/editclassifications.cgi index deeffdce7..7fd26366b 100755 --- a/editclassifications.cgi +++ b/editclassifications.cgi @@ -300,7 +300,7 @@ if ($action eq 'update') { if ($classification ne $classificationold) { unless ($classification) { - ThrowUserError("classification_not_specified") + ThrowUserError("classification_not_specified"); } if (TestClassification($classification)) { diff --git a/editcomponents.cgi b/editcomponents.cgi index d21518fce..a8d1f1f90 100755 --- a/editcomponents.cgi +++ b/editcomponents.cgi @@ -67,13 +67,11 @@ sub CheckProduct ($) # do we have a product? unless ($prod) { ThrowUserError('product_not_specified'); - exit; } unless (TestProduct $prod) { ThrowUserError('product_doesnt_exist', {'product' => $prod}); - exit; } } @@ -97,7 +95,6 @@ sub CheckComponent ($$) # do we have the component? unless ($comp) { ThrowUserError('component_not_specified'); - exit; } CheckProduct($prod); @@ -106,7 +103,6 @@ sub CheckComponent ($$) ThrowUserError('component_not_valid', {'product' => $prod, 'name' => $comp}); - exit; } } @@ -267,18 +263,15 @@ if ($action eq 'new') { unless ($component) { ThrowUserError('component_blank_name', {'name' => $component}); - exit; } if (TestComponent($product, $component)) { ThrowUserError('component_already_exists', {'name' => $component}); - exit; } if (length($component) > 64) { ThrowUserError('component_name_too_long', {'name' => $component}); - exit; } my $description = trim($cgi->param('description') || ''); @@ -286,7 +279,6 @@ if ($action eq 'new') { if ($description eq '') { ThrowUserError('component_blank_description', {'name' => $component}); - exit; } my $initialowner = trim($cgi->param('initialowner') || ''); @@ -294,14 +286,12 @@ if ($action eq 'new') { if ($initialowner eq '') { ThrowUserError('component_need_initialowner', {'name' => $component}); - exit; } my $initialownerid = login_to_id ($initialowner); if (!$initialownerid) { ThrowUserError('component_need_valid_initialowner', {'name' => $component}); - exit; } my $initialqacontact = trim($cgi->param('initialqacontact') || ''); @@ -310,7 +300,6 @@ if ($action eq 'new') { if (!$initialqacontactid && $initialqacontact ne '') { ThrowUserError('component_need_valid_initialqacontact', {'name' => $component}); - exit; } } @@ -571,7 +560,6 @@ if ($action eq 'update') { if (length($component) > 64) { ThrowUserError('component_name_too_long', {'name' => $component}); - exit; } # Note that the order of this tests is important. If you change @@ -587,7 +575,6 @@ if ($action eq 'update') { unless ($description) { ThrowUserError('component_blank_description', {'name' => $componentold}); - exit; } SendSQL("UPDATE components SET description=" . SqlQuote($description) . " @@ -604,7 +591,6 @@ if ($action eq 'update') { unless ($initialownerid) { ThrowUserError('component_need_valid_initialowner', {'name' => $componentold}); - exit; } SendSQL("UPDATE components @@ -621,7 +607,6 @@ if ($action eq 'update') { if (!$initialqacontactid && $initialqacontact ne '') { ThrowUserError('component_need_valid_initialqacontact', {'name' => $componentold}); - exit; } SendSQL("UPDATE components @@ -637,12 +622,10 @@ if ($action eq 'update') { unless ($component) { ThrowUserError('component_must_have_a_name', {'name' => $componentold}); - exit; } if (TestComponent($product, $component)) { ThrowUserError('component_already_exists', {'name' => $component}); - exit; } SendSQL("UPDATE components SET name=" . SqlQuote($component) . diff --git a/editkeywords.cgi b/editkeywords.cgi index 9c835e8b7..4f4cf4bd5 100755 --- a/editkeywords.cgi +++ b/editkeywords.cgi @@ -37,15 +37,12 @@ sub Validate ($$) { my ($name, $description) = @_; if ($name eq "") { ThrowUserError("keyword_blank_name"); - exit; } if ($name =~ /[\s,]/) { ThrowUserError("keyword_invalid_name"); - exit; } if ($description eq "") { ThrowUserError("keyword_blank_description"); - exit; } } @@ -124,7 +121,6 @@ if ($action eq 'new') { if (FetchOneColumn()) { $vars->{'name'} = $name; ThrowUserError("keyword_already_exists"); - exit; } @@ -183,7 +179,6 @@ if ($action eq 'edit') { if (!$name) { $vars->{'id'} = $id; ThrowCodeError("invalid_keyword_id", $vars); - exit; } SendSQL("SELECT count(*) @@ -227,7 +222,6 @@ if ($action eq 'update') { if ($tmp && $tmp != $id) { $vars->{'name'} = $name; ThrowUserError("keyword_already_exists", $vars); - exit; } SendSQL("UPDATE keyworddefs SET name = " . SqlQuote($name) . diff --git a/editmilestones.cgi b/editmilestones.cgi index 7317e7220..85bcae8d3 100755 --- a/editmilestones.cgi +++ b/editmilestones.cgi @@ -60,14 +60,12 @@ sub CheckProduct ($) # do we have a product? unless ($product) { ThrowUserError('product_not_specified'); - exit; } # Does it exist in the DB? unless (TestProduct $product) { ThrowUserError('product_doesnt_exist', {'product' => $product}); - exit; } } @@ -104,7 +102,6 @@ sub CheckMilestone ($$) # do we have the milestone and product combination? unless ($milestone) { ThrowUserError('milestone_not_specified'); - exit; } CheckProduct($product); @@ -113,7 +110,6 @@ sub CheckMilestone ($$) ThrowUserError('milestone_not_valid', {'product' => $product, 'milestone' => $milestone}); - exit; } } @@ -254,13 +250,11 @@ if ($action eq 'new') { unless ($milestone) { ThrowUserError('milestone_blank_name', {'name' => $milestone}); - exit; } if (length($milestone) > 20) { ThrowUserError('milestone_name_too_long', {'name' => $milestone}); - exit; } # Need to store in case detaint_natural() clears the sortkey @@ -269,13 +263,11 @@ if ($action eq 'new') { ThrowUserError('milestone_sortkey_invalid', {'name' => $milestone, 'sortkey' => $stored_sortkey}); - exit; } if (TestMilestone($product, $milestone)) { ThrowUserError('milestone_already_exists', {'name' => $milestone, 'product' => $product}); - exit; } # Add the new milestone @@ -492,7 +484,6 @@ if ($action eq 'update') { if (length($milestone) > 20) { ThrowUserError('milestone_name_too_long', {'name' => $milestone}); - exit; } my $dbh = Bugzilla->dbh; @@ -509,7 +500,6 @@ if ($action eq 'update') { ThrowUserError('milestone_sortkey_invalid', {'name' => $milestone, 'sortkey' => $stored_sortkey}); - exit; } trick_taint($milestoneold); @@ -530,13 +520,11 @@ if ($action eq 'update') { if ($milestone ne $milestoneold) { unless ($milestone) { ThrowUserError('milestone_blank_name'); - exit; } if (TestMilestone($product, $milestone)) { ThrowUserError('milestone_already_exists', {'name' => $milestone, 'product' => $product}); - exit; } trick_taint($milestone); diff --git a/editproducts.cgi b/editproducts.cgi index 11658c29a..db391228b 100755 --- a/editproducts.cgi +++ b/editproducts.cgi @@ -129,13 +129,11 @@ sub CheckClassificationNew ($) # do we have a classification? unless ($cl) { ThrowUserError('classification_not_specified'); - exit; } unless (TestClassification $cl) { ThrowUserError('classification_doesnt_exist', {'name' => $cl}); - exit; } } diff --git a/editversions.cgi b/editversions.cgi index 60f60057e..7faea7c8d 100755 --- a/editversions.cgi +++ b/editversions.cgi @@ -64,13 +64,11 @@ sub CheckProduct ($) # do we have a product? unless ($prod) { ThrowUserError('product_not_specified'); - exit; } unless (TestProduct $prod) { ThrowUserError('product_doesnt_exist', {'product' => $prod}); - exit; } } @@ -94,7 +92,6 @@ sub CheckVersion ($$) # do we have the version? unless ($ver) { ThrowUserError('version_not_specified'); - exit; } CheckProduct($prod); @@ -103,7 +100,6 @@ sub CheckVersion ($$) ThrowUserError('version_not_valid', {'product' => $prod, 'version' => $ver}); - exit; } } @@ -233,14 +229,12 @@ if ($action eq 'new') { unless ($version) { ThrowUserError('version_blank_name', {'name' => $version}); - exit; } if (TestVersion($product,$version)) { ThrowUserError('version_already_exists', {'name' => $version, 'product' => $product}); - exit; } # Add the new version @@ -407,13 +401,11 @@ if ($action eq 'update') { if ($version ne $versionold) { unless ($version) { ThrowUserError('version_blank_name'); - exit; } if (TestVersion($product,$version)) { ThrowUserError('version_already_exists', {'name' => $version, 'product' => $product}); - exit; } SendSQL("UPDATE bugs SET version=" . SqlQuote($version) . " -- cgit v1.2.3-24-g4f1b