]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 237774: The text "bug 0" auto-linkifies to "<missing bug number>" - Patch by...
authorlpsolit%gmail.com <>
Fri, 13 May 2005 00:52:46 +0000 (00:52 +0000)
committerlpsolit%gmail.com <>
Fri, 13 May 2005 00:52:46 +0000 (00:52 +0000)
globals.pl

index 009f93ee94f0e8b3c6fe858b099482610fb19634..09be4e7325193687c9d63ec9871183ddb26f891a 100644 (file)
@@ -894,8 +894,11 @@ sub GetAttachmentLink {
 
 sub GetBugLink {
     my ($bug_num, $link_text, $comment_num) = @_;
-    $bug_num || return "&lt;missing bug number&gt;";
-    detaint_natural($bug_num) || return "&lt;invalid bug number&gt;";
+    if (! defined $bug_num || $bug_num eq "") {
+        return "&lt;missing bug number&gt;";
+    }
+    my $quote_bug_num = html_quote($bug_num);
+    detaint_natural($bug_num) || return "&lt;invalid bug number: $quote_bug_num&gt;";
 
     # If we've run GetBugLink() for this bug number before, %::buglink
     # will contain an anonymous array ref of relevent values, if not