]> git.donarmstrong.com Git - debbugs.git/commitdiff
Return 404 when a bug number that does not exist is used
authorDon Armstrong <don@donarmstrong.com>
Wed, 24 Sep 2008 15:49:51 +0000 (08:49 -0700)
committerDon Armstrong <don@donarmstrong.com>
Wed, 24 Sep 2008 15:49:51 +0000 (08:49 -0700)
(closes: #499997)

Debbugs/Common.pm
cgi/bugreport.cgi
debian/changelog
templates/en_US/cgi/no_such_bug.tmpl

index a444a469d432a258556c8c9cf7436d406f94593a..87b355924458444536aff9a27c2a1d3a52ee593e 100644 (file)
@@ -162,6 +162,8 @@ sub get_hashname {
 
 Returns the path to the logfile corresponding to the bug.
 
+Returns undef if the bug does not exist.
+
 =cut
 
 sub buglog {
@@ -169,7 +171,8 @@ sub buglog {
     my $location = getbuglocation($bugnum, 'log');
     return getbugcomponent($bugnum, 'log', $location) if ($location);
     $location = getbuglocation($bugnum, 'log.gz');
-    return getbugcomponent($bugnum, 'log.gz', $location);
+    return getbugcomponent($bugnum, 'log.gz', $location) if ($location);
+    return undef;
 }
 
 
index b325863e8b699a95585e1f4276bde50f7a85ce7d..d01a286bf39e9097db6efc2e8f27fb0620bdab0c 100755 (executable)
@@ -71,6 +71,14 @@ my $archive = $param{'archive'} eq 'yes';
 my $repeatmerged = $param{'repeatmerged'} eq 'yes';
 
 my $buglog = buglog($ref);
+if (not defined $buglog) {
+     print $q->header(-status => "404 No such bug",
+                     -type => "text/html",
+                     -charset => 'utf-8',
+                    );
+     exit 0;
+}
+
 my @stat = stat $buglog;
 my $mtime = '';
 if (@stat) {
index f4ddd6bd6006a4634510693fb138af11db0cab66..949ef46a33283457dd7b94858bfd19561fce95ab 100644 (file)
@@ -222,6 +222,8 @@ debbugs (2.4.2) UNRELEASED; urgency=low
   * Add correspondent option to track bug correpondents (closes: #485804)
   * Allow clicking anywhere outside the extra status box to close the
     extra status box (closes: #499990) Thanks to James Vega for the patch.
+  * Return 404 when a bug number that does not exist is used
+    (closes: #499997)
 
   
  -- Colin Watson <cjwatson@debian.org>  Fri, 20 Jun 2003 18:57:25 +0100
index 107f9f29aeba22ebd96b65859bbcaec58ef4e881..5434b53be0f4385b97f1651579645e5c2387bbd2 100644 (file)
@@ -5,5 +5,5 @@
 <h1>{$config{project}} {$config{bug}} report logs - #{$bug_num}</h1>
 <p>There is no record of {$config{bug}} #{$bug_num}.
 Try the <a href="http://{$config{web_domain}}/">search page</a> instead.</p>
-{include('html/tail')}
+{#include('html/html_tail')}
 </body></html>