summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-05-13 02:52:46 +0200
committerlpsolit%gmail.com <>2005-05-13 02:52:46 +0200
commit0de74ae8ec895b9085ee7afed47cd90fe52744c6 (patch)
tree69aa411206ce0901a4bdb8ddd59e75cf14202db4
parentd85c44a118877fc4854ae3b0ed7b1af8e0008c97 (diff)
downloadbugzilla-0de74ae8ec895b9085ee7afed47cd90fe52744c6.tar.gz
bugzilla-0de74ae8ec895b9085ee7afed47cd90fe52744c6.tar.xz
Bug 237774: The text "bug 0" auto-linkifies to "<missing bug number>" - Patch by Nick Barnes <nb+bz@ravenbrook.com> r=LpSolit a=myk
-rw-r--r--globals.pl7
1 files changed, 5 insertions, 2 deletions
diff --git a/globals.pl b/globals.pl
index 009f93ee9..09be4e732 100644
--- a/globals.pl
+++ b/globals.pl
@@ -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