From 88730095c09fc5b9822a25aff919ca32f2a54508 Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 15 May 2014 13:28:49 -0400 Subject: [PATCH] Process bugtraq links in the ticket description and comments --- releases.moxie | 1 + src/main/java/com/gitblit/wicket/pages/TicketPage.java | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/releases.moxie b/releases.moxie index 7c12f30b..049a2826 100644 --- a/releases.moxie +++ b/releases.moxie @@ -22,6 +22,7 @@ r24: { - Move repository deletion functions to the edit repository page AND allow deletion to be disabled (pr-180, ticket-67) - Update the Korean translation (pr-184, ticket-69) - Overhaul the EmptyRepositoryPage (ticket-73) + - Process bugtraq links in the ticket description and comments (ticket-78) additions: - Add My Tickets page (issue-215, ticket-15) - Added CRUD functionality for Ticket Milestones (ticket-17) diff --git a/src/main/java/com/gitblit/wicket/pages/TicketPage.java b/src/main/java/com/gitblit/wicket/pages/TicketPage.java index c066f24d..c8ec2f8c 100644 --- a/src/main/java/com/gitblit/wicket/pages/TicketPage.java +++ b/src/main/java/com/gitblit/wicket/pages/TicketPage.java @@ -278,7 +278,8 @@ public class TicketPage extends RepositoryPage { if (StringUtils.isEmpty(ticket.body)) { desc = getString("gb.noDescriptionGiven"); } else { - desc = MarkdownUtils.transformGFM(app().settings(), ticket.body, ticket.repository); + String bugtraq = bugtraqProcessor().processPlainCommitMessage(getRepository(), repositoryName, ticket.body); + desc = MarkdownUtils.transformGFM(app().settings(), bugtraq, ticket.repository); } add(new Label("ticketDescription", desc).setEscapeModelStrings(false)); @@ -685,7 +686,8 @@ public class TicketPage extends RepositoryPage { /* * COMMENT */ - String comment = MarkdownUtils.transformGFM(app().settings(), entry.comment.text, repositoryName); + String bugtraq = bugtraqProcessor().processPlainCommitMessage(getRepository(), repositoryName, entry.comment.text); + String comment = MarkdownUtils.transformGFM(app().settings(), bugtraq, repositoryName); Fragment frag = new Fragment("entry", "commentFragment", this); Label commentIcon = new Label("commentIcon"); if (entry.comment.src == CommentSource.Email) { -- 2.39.5