]> git.donarmstrong.com Git - debbugs.git/commitdiff
fix linkification of CVE reports
authorDon Armstrong <don@donarmstrong.com>
Tue, 23 Feb 2010 02:13:04 +0000 (18:13 -0800)
committerDon Armstrong <don@donarmstrong.com>
Tue, 23 Feb 2010 02:13:04 +0000 (18:13 -0800)
Debbugs/CGI/Bugreport.pm

index 2359837fa42620536c348157e0095d8f34e58dc3..7f58514dbe3cb97bb68f3ed5cda6af9989b2ccad 100644 (file)
@@ -256,8 +256,8 @@ sub display_entity {
             length $config{cve_tracker}
            ) {
             # Add links to CVE vulnerabilities (closes #568464)
-            $body =~ s{(CVE-\d{4}-\d{4,})}
-                      {<a href="http://$config{cve_tracker}$1">$1</a>}gx;
+            $body =~ s{(^|\s)(CVE-\d{4}-\d{4,})(\s|[,.-]|$)}
+                      {$1<a href="http://$config{cve_tracker}$2">$2</a>$3}gxm;
         }
         if (not exists $param{att}) {
              print {$param{output}} qq(<pre class="message">$body</pre>\n);