Merge pull request #4639 from tractorcow/pulls/4.0/fix-controller-url

BUG Replace direct reference to $_REQUEST['url'] with request object getter
This commit is contained in:
Sam Minnée 2015-09-29 12:55:53 +13:00
commit 32e343d668

View File

@ -334,7 +334,8 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler {
if (empty($this->record)) { if (empty($this->record)) {
$controller = $this->getToplevelController(); $controller = $this->getToplevelController();
$noActionURL = $controller->removeAction($_REQUEST['url']); $url = $controller->getRequest()->getURL();
$noActionURL = $controller->removeAction($url);
$controller->getResponse()->removeHeader('Location'); //clear the existing redirect $controller->getResponse()->removeHeader('Location'); //clear the existing redirect
return $controller->redirect($noActionURL, 302); return $controller->redirect($noActionURL, 302);
} }
@ -588,7 +589,8 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler {
} else { } else {
// Changes to the record properties might've excluded the record from // 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 // 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'); $controller->getRequest()->addHeader('X-Pjax', 'Content');
return $controller->redirect($noActionURL, 302); return $controller->redirect($noActionURL, 302);
} }