summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2004-05-12 14:08:28 +0200
committerbugreport%peshkin.net <>2004-05-12 14:08:28 +0200
commitce5d97efa0895d090493cf7ea5865f8684653af7 (patch)
treee757afb734faaf1e724f167b2ab0f70b0638a1e1
parent3388e43d9ff89eb14b803a9b069a4d0e6b08766c (diff)
downloadbugzilla-ce5d97efa0895d090493cf7ea5865f8684653af7.tar.gz
bugzilla-ce5d97efa0895d090493cf7ea5865f8684653af7.tar.xz
Bug 232861: Prevent references to bugs or comments from being expanded in attachment links
r=timeless,a=justdave
-rw-r--r--globals.pl8
1 files changed, 5 insertions, 3 deletions
diff --git a/globals.pl b/globals.pl
index 3670ff508..055584f7e 100644
--- a/globals.pl
+++ b/globals.pl
@@ -875,13 +875,15 @@ sub quoteUrls {
$text =~ s~\b(mailto:|)?([\w\.\-\+\=]+\@[\w\-]+(?:\.[\w\-]+)+)\b
~<a href=\"mailto:$2\">$1$2</a>~igx;
- # attachment links - handle both cases separatly for simplicity
+ # attachment links - handle both cases separately for simplicity
$text =~ s~((?:^Created\ an\ |\b)attachment\s*\(id=(\d+)\))
- ~GetAttachmentLink($2, $1)
+ ~($things[$count++] = GetAttachmentLink($2, $1)) &&
+ ("\0\0" . ($count-1) . "\0\0")
~egmx;
$text =~ s~\b(attachment\s*\#?\s*(\d+))
- ~GetAttachmentLink($2, $1)
+ ~($things[$count++] = GetAttachmentLink($2, $1)) &&
+ ("\0\0" . ($count-1) . "\0\0")
~egmxi;
# This handles bug a, comment b type stuff. Because we're using /g