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
This commit is contained in:
Sean Harvey 2009-10-21 04:38:41 +00:00
parent 9b234ca7f1
commit 31e996a56b

View File

@ -57,7 +57,9 @@ class PageComment extends DataObject {
}
function CommentTextWithLinks() {
return preg_replace("#\[(([a-zA-Z]+://)([a-zA-Z0-9?&%.;:/=+_-]*))\]#", "'<a rel=\"nofollow\" href=\"$1\" target=\"_blank\">$1</a>'", $this->Comment);
$pattern = '|([a-zA-Z]+://)([a-zA-Z0-9?&%.;:/=+_-]*)|is';
$replace = '<a rel="nofollow" href="$1$2">$1$2</a>';
return preg_replace($pattern, $replace, $this->Comment);
}
function SpamLink() {