mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
ENHANCEMENT: hide unmoderated page comments from the page comment RSS feed. Ticket #4477
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@85731 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d60fc2fdce
commit
13a1409bc6
@ -161,7 +161,8 @@ class PageComment extends DataObject {
|
||||
class PageComment_Controller extends Controller {
|
||||
function rss() {
|
||||
$parentcheck = isset($_REQUEST['pageid']) ? "\"ParentID\" = " . (int) $_REQUEST['pageid'] : "\"ParentID\" > 0";
|
||||
$comments = DataObject::get("PageComment", "$parentcheck AND NOT \"IsSpam\"", "\"Created\" DESC", "", 10);
|
||||
$unmoderatedfilter = Permission::check('ADMIN') ? '' : "AND NOT \"NeedsModeration\"";
|
||||
$comments = DataObject::get("PageComment", "$parentcheck AND NOT \"IsSpam\" $unmoderatedfilter", "\"Created\" DESC", "", 10);
|
||||
if(!isset($comments)) {
|
||||
$comments = new DataObjectSet();
|
||||
}
|
||||
@ -281,4 +282,4 @@ class PageComment_Controller extends Controller {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user