mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
MINOR Using raw2sql in CMSMain->delete()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@85984 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
244fc8d64a
commit
61776f1e74
@ -621,9 +621,11 @@ JS;
|
||||
* Delete the current page from draft stage.
|
||||
* @see deletefromlive()
|
||||
*/
|
||||
public function delete($urlParams, $form) {
|
||||
$id = $_REQUEST['ID'];
|
||||
$record = DataObject::get_one("SiteTree", "\"SiteTree\".\"ID\" = $id");
|
||||
public function delete($data, $form) {
|
||||
$record = DataObject::get_one(
|
||||
"SiteTree",
|
||||
sprintf("\"SiteTree\".\"ID\" = %d", Convert::raw2sql($data['ID']))
|
||||
);
|
||||
if($record && !$record->canDelete()) return Security::permissionFailure();
|
||||
|
||||
// save ID and delete record
|
||||
|
Loading…
Reference in New Issue
Block a user