From 1f632a10c9661d7f7eb27bd1fcf7e03081e8010e Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Tue, 29 Sep 2015 11:29:05 +1300 Subject: [PATCH] BUG Replace direct reference to $_REQUEST['url'] with request object getter --- forms/gridfield/GridFieldDetailForm.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/forms/gridfield/GridFieldDetailForm.php b/forms/gridfield/GridFieldDetailForm.php index 5eeabcfcb..c6414e860 100644 --- a/forms/gridfield/GridFieldDetailForm.php +++ b/forms/gridfield/GridFieldDetailForm.php @@ -334,7 +334,8 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler { if (empty($this->record)) { $controller = $this->getToplevelController(); - $noActionURL = $controller->removeAction($_REQUEST['url']); + $url = $controller->getRequest()->getURL(); + $noActionURL = $controller->removeAction($url); $controller->getResponse()->removeHeader('Location'); //clear the existing redirect return $controller->redirect($noActionURL, 302); } @@ -588,7 +589,8 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler { } else { // Changes to the record properties might've excluded the record from // a filtered list, so return back to the main view if it can't be found - $noActionURL = $controller->removeAction($data['url']); + $url = $controller->getRequest()->getURL(); + $noActionURL = $controller->removeAction($url); $controller->getRequest()->addHeader('X-Pjax', 'Content'); return $controller->redirect($noActionURL, 302); }