From c068e2b90f06f898217dc9919371a583517d985e Mon Sep 17 00:00:00 2001 From: "jake%bugzilla.org" <> Date: Tue, 21 Dec 2004 17:04:00 +0000 Subject: Bug 264601 - Bugzilla will now tell a user which field contained an "invalid bug number or alias." Patch by Frédéric Buclin r=myk, a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CGI.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'CGI.pl') diff --git a/CGI.pl b/CGI.pl index 456022808..0d03562fe 100644 --- a/CGI.pl +++ b/CGI.pl @@ -148,7 +148,7 @@ sub ValidateBugID { # database, and that the user is authorized to access that bug. # We detaint the number here, too - my ($id, $skip_authorization) = @_; + my ($id, $field) = @_; # Get rid of white-space around the ID. $id = trim($id); @@ -157,7 +157,9 @@ sub ValidateBugID { my $alias = $id; if (!detaint_natural($id)) { $id = BugAliasToID($alias); - $id || ThrowUserError("invalid_bug_id_or_alias", {'bug_id' => $alias}); + $id || ThrowUserError("invalid_bug_id_or_alias", + {'bug_id' => $alias, + 'field' => $field }); } # Modify the calling code's original variable to contain the trimmed, @@ -170,7 +172,7 @@ sub ValidateBugID { FetchOneColumn() || ThrowUserError("invalid_bug_id_non_existent", {'bug_id' => $id}); - return if $skip_authorization; + return if ($field eq "dependson" || $field eq "blocked"); return if Bugzilla->user->can_see_bug($id); -- cgit v1.2.3-24-g4f1b