mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
BUGFIX Using auto-escaped get_by_id() in CommentAdmin and SecurityAdmin
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@73247 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
9260326ee6
commit
e73b66036a
@ -125,7 +125,7 @@ class CommentAdmin extends LeftAndMain {
|
||||
|
||||
if($_REQUEST['Comments']) {
|
||||
foreach($_REQUEST['Comments'] as $commentid) {
|
||||
$comment = DataObject::get_one('PageComment', "\"PageComment\".\"ID\" = $commentid");
|
||||
$comment = DataObject::get_by_id('PageComment', $commentid);
|
||||
if($comment) {
|
||||
$comment->delete();
|
||||
$numComments++;
|
||||
@ -169,7 +169,7 @@ JS;
|
||||
|
||||
if($_REQUEST['Comments']) {
|
||||
foreach($_REQUEST['Comments'] as $commentid) {
|
||||
$comment = DataObject::get_one('PageComment', "\"PageComment\".\"ID\" = $commentid");
|
||||
$comment = DataObject::get_by_id('PageComment', $commentid);
|
||||
if($comment) {
|
||||
$comment->IsSpam = true;
|
||||
$comment->NeedsModeration = false;
|
||||
@ -208,7 +208,7 @@ JS;
|
||||
|
||||
if($_REQUEST['Comments']) {
|
||||
foreach($_REQUEST['Comments'] as $commentid) {
|
||||
$comment = DataObject::get_one('PageComment', "\"PageComment\".\"ID\" = $commentid");
|
||||
$comment = DataObject::get_by_id('PageComment', $commentid);
|
||||
if($comment) {
|
||||
$comment->IsSpam = false;
|
||||
$comment->NeedsModeration = false;
|
||||
@ -248,7 +248,7 @@ JS;
|
||||
|
||||
if($_REQUEST['Comments']) {
|
||||
foreach($_REQUEST['Comments'] as $commentid) {
|
||||
$comment = DataObject::get_one('PageComment', "\"PageComment\".\"ID\" = $commentid");
|
||||
$comment = DataObject::get_by_id('PageComment', $commentid);
|
||||
if($comment) {
|
||||
$comment->IsSpam = false;
|
||||
$comment->NeedsModeration = false;
|
||||
|
@ -155,7 +155,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
||||
if($id == 'new') $id = null;
|
||||
|
||||
if($id) {
|
||||
$record = DataObject::get_one($className, "\"$className\".\"ID\" = $id");
|
||||
$record = DataObject::get_by_id($className, $id);
|
||||
if($record && !$record->canEdit()) return Security::permissionFailure($this);
|
||||
} else {
|
||||
if(!singleton($this->stat('subitem_class'))->canCreate()) return Security::permissionFailure($this);
|
||||
@ -185,7 +185,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
||||
$record->update($data);
|
||||
$record->write();
|
||||
|
||||
if($data['GroupID']) $record->Groups()->add($data['GroupID']);
|
||||
if($data['GroupID']) $record->Groups()->add((int)$data['GroupID']);
|
||||
|
||||
FormResponse::add("reloadMemberTableField();");
|
||||
|
||||
@ -199,7 +199,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
||||
$member = DataObject::get_by_id('Member', (int) $memberID);
|
||||
if(!$member->canDelete()) return Security::permissionFailure($this);
|
||||
|
||||
$member->Groups()->remove($groupID);
|
||||
$member->Groups()->remove((int)$groupID);
|
||||
FormResponse::add("reloadMemberTableField();");
|
||||
} else {
|
||||
user_error("SecurityAdmin::removememberfromgroup: Bad parameters: Group=$groupID, Member=$memberID", E_USER_ERROR);
|
||||
|
Loading…
x
Reference in New Issue
Block a user