mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
MINOR added the ability to link URLs in comments (with rel=nofollow) (from r83182)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@89816 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
399f9d4e31
commit
9b234ca7f1
@ -56,6 +56,10 @@ 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);
|
||||||
|
}
|
||||||
|
|
||||||
function SpamLink() {
|
function SpamLink() {
|
||||||
$member = Member::currentUser();
|
$member = Member::currentUser();
|
||||||
if(Permission::check('CMS_ACCESS_CMSMain') && !$this->getField('IsSpam')) {
|
if(Permission::check('CMS_ACCESS_CMSMain') && !$this->getField('IsSpam')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user