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() {