From 24bf6d11edd72edd34b5effa68aad9ca0984e913 Mon Sep 17 00:00:00 2001 From: "tara%tequilarista.org" <> Date: Sun, 3 Jun 2001 05:02:01 +0000 Subject: Landing Myk's patch for bug #71767 --- show_bug.cgi | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'show_bug.cgi') diff --git a/show_bug.cgi b/show_bug.cgi index 83baa42b5..eced9cfbe 100755 --- a/show_bug.cgi +++ b/show_bug.cgi @@ -29,12 +29,28 @@ ConnectToDatabase(); if ($::FORM{'GoAheadAndLogIn'}) { confirm_login(); +} else { + quietly_check_login(); } +###################################################################### +# Begin Data/Security Validation +###################################################################### + +# Make sure the bug ID is a positive integer representing an existing +# bug that the user is authorized to access. +if (defined ($::FORM{'id'})) { + ValidateBugID($::FORM{'id'}); +} + +###################################################################### +# End Data/Security Validation +###################################################################### + print "Content-type: text/html\n"; print "\n"; -if (!defined $::FORM{'id'} || $::FORM{'id'} !~ /^\s*\d+\s*$/) { +if (!defined $::FORM{'id'}) { PutHeader("Search by bug number"); print "
\n"; print "You may find a single bug by entering its bug id here: \n"; @@ -47,14 +63,13 @@ if (!defined $::FORM{'id'} || $::FORM{'id'} !~ /^\s*\d+\s*$/) { GetVersionTable(); -SendSQL("select short_desc, groupset from bugs where bug_id = $::FORM{'id'}"); -my ($summary, $groupset) = FetchSQLData(); -if( $summary && $groupset == 0) { - $summary = html_quote($summary); - PutHeader("Bug $::FORM{'id'} - $summary", "Bugzilla Bug $::FORM{'id'}", $summary ); -}else { - PutHeader("Bugzilla bug $::FORM{'id'}", "Bugzilla Bug", $::FORM{'id'}); -} +# Get the bug's summary (short description) and display it as +# the page title. +SendSQL("SELECT short_desc FROM bugs WHERE bug_id = $::FORM{'id'}"); +my ($summary) = FetchSQLData(); +$summary = html_quote($summary); +PutHeader("Bug $::FORM{'id'} - $summary", "Bugzilla Bug $::FORM{'id'}", $summary ); + navigation_header(); print "
\n"; -- cgit v1.2.3-24-g4f1b