]> git.donarmstrong.com Git - debbugs.git/commitdiff
Don't linkify trailing ; in bug messages (closes #1076323)
authorDon Armstrong <don@donarmstrong.com>
Mon, 22 Jul 2024 03:06:11 +0000 (20:06 -0700)
committerDon Armstrong <don@donarmstrong.com>
Mon, 22 Jul 2024 03:06:11 +0000 (20:06 -0700)
Debbugs/CGI/Bugreport.pm
debian/changelog
t/07_bugreport.t

index f02bf784a74ee79c9e3ba3ab3736579453eab2a6..97356df658a586fd1c03ddbc79c08e90ae3aea28 100644 (file)
@@ -287,7 +287,7 @@ sub display_entity {
         # We don't html escape here because we escape above;
         # wierd terminators are because of that
         $body =~ s{((?:ftp|http|https|svn|ftps|rsync)://[\S~-]+?/?) # Url
-                   ((?:\&gt\;)?[)]?(?:'|\&\#39\;|\&quot\;)?[:.\,]?(?:\s|$)) # terminators
+                   ((?:\&gt\;)?[)]?(?:'|\&\#39\;|\&quot\;)?[:.\,;]?(?:\s|$)) # terminators
              }{<a href=\"$1\">$1</a>$2}gox;
         # Add links to bug closures
         $body =~ s[((?:closes|see):\s* # start of closed/referenced bugs
index e5d9aa0600cab82fd88bb3e3525145ef34e5963d..0e3917e238d8eac6df1a39bcc07e9a48669c6731 100644 (file)
@@ -6,6 +6,8 @@ debbugs (2.6.1) unstable; urgency=medium
     of mbox (closes: #1009181)
   * Fix missing escaping of comma in address fields (closes: #1041638)
   * Sort blocked-by (closes: 751808), thanks to Tim Landscheidt.
+  * Don't linkify trailing ; in bug messages (closes: #1076323), thanks to
+    Blair Noctis.
 
  -- Don Armstrong <don@debian.org>  Fri, 09 Mar 2018 11:17:10 -0800
 
index 6af469195a8cb5b2e86d0442331a0182046cee44..2ece25b3e3ae5a5e5630c40da1b67ad9967d4dff 100644 (file)
@@ -1,7 +1,7 @@
 # -*- mode: cperl;-*-
 
 
-use Test::More tests => 19;
+use Test::More tests => 22;
 
 use warnings;
 use strict;
@@ -150,4 +150,24 @@ EOF
 }
 
 # Other tests for bugs in the page should be added here eventually
+send_message(to => '1@bugs.something',
+              headers => [To   => '1@bugs.something',
+                          From => 'foo@bugs.something',
+                          Subject => "Message with some links to linkify",
+                         ],
+              body => <<EOF) or fail 'message to 1@bugs.something failed';
+This is a test message.
+
+This is a link https://example.com/foo; which should not include the ;
+
+
+This is a link https://example.com/foo;bar which should include the ;
+EOF
+
+$mech->get_ok('http://localhost:'.$port.'/?bug=1',
+               'Page received ok');
+like($mech->content(), qr(href="https://example.com/foo;bar"),
+     'Link includes ; correctly');
 
+like($mech->content(), qr(href="https://example.com/foo"),
+     'Link excludes trailing ;');