From 31e996a56be46111ef2a4dcb68b48fb4a5f04703 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 21 Oct 2009 04:38:41 +0000 Subject: [PATCH] MINOR fixed comment text linking (from r83187) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@89818 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/sitefeatures/PageComment.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/sitefeatures/PageComment.php b/code/sitefeatures/PageComment.php index fb478e7d..78492847 100755 --- a/code/sitefeatures/PageComment.php +++ b/code/sitefeatures/PageComment.php @@ -57,7 +57,9 @@ class PageComment extends DataObject { } function CommentTextWithLinks() { - return preg_replace("#\[(([a-zA-Z]+://)([a-zA-Z0-9?&%.;:/=+_-]*))\]#", "'$1'", $this->Comment); + $pattern = '|([a-zA-Z]+://)([a-zA-Z0-9?&%.;:/=+_-]*)|is'; + $replace = '$1$2'; + return preg_replace($pattern, $replace, $this->Comment); } function SpamLink() {