From 1f0791df0e766a84454672b7fd30a2babb6c765d Mon Sep 17 00:00:00 2001 From: Thomas Keller Date: Mon, 12 Sep 2011 17:54:40 +0200 Subject: [PATCH] Make the '@rev' part in the regex optional (fixes issue 730). --- NEWS.mdtext | 1 + src/IDF/Template/IssueComment.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS.mdtext b/NEWS.mdtext index 4732038..882a660 100644 --- a/NEWS.mdtext +++ b/NEWS.mdtext @@ -31,6 +31,7 @@ or newer to properly run this version of Indefero! a new project or monotone key, in case an error popped up in the middle (issue 697) - Indefero now sends the MD5 checksum as HTTP header when downloading a file from the download area. Additionally, a unneeded redirect has been removed. (issue 716) +- Source links without a specific revision did not work due to a wrong regex (issue 730) - Better error detection and reporting in the SyncMonotone plugin ATTENTION: This needs Pluf 46b7f251 or newer! - Fix the branch links users of the Subversion frontend get when they enter a wrong revision diff --git a/src/IDF/Template/IssueComment.php b/src/IDF/Template/IssueComment.php index da7fe19..f2b8e84 100644 --- a/src/IDF/Template/IssueComment.php +++ b/src/IDF/Template/IssueComment.php @@ -58,7 +58,7 @@ class IDF_Template_IssueComment extends Pluf_Template_Tag implode('|', $nouns); $text = IDF_Template_safePregReplace('#((?:'.$prefix.')(?:\s+r?))([0-9a-f]{1,40}((?:\s+and|\s+or|,)\s+r?[0-9a-f]{1,40})*)\b#i', array($this, 'callbackCommits'), $text); - $text = IDF_Template_safePregReplace('=(src:)([^\s@#,\(\)\\\\]+(?:(\\\\)[\s@#][^\s@#,\(\)\\\\]+){0,})+(?:\@([^\s#,]+))(?:#(\d+))?=im', + $text = IDF_Template_safePregReplace('=(src:)([^\s@#,\(\)\\\\]+(?:(\\\\)[\s@#][^\s@#,\(\)\\\\]+){0,})+(?:\@([^\s#,]+))?(?:#(\d+))?=im', array($this, 'callbackSource'), $text); } if ($wordwrap) $text = Pluf_Text::wrapHtml($text, 69, "\n");