mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
commit
32e343d668
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user