mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Including GET parameters in X-ControllerURL default headers (which fixes e.g. AssetAdmin search persistence)
This commit is contained in:
parent
eecca9b73a
commit
620b23a23f
@ -328,7 +328,14 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
|||||||
$response = parent::handleRequest($request, $model);
|
$response = parent::handleRequest($request, $model);
|
||||||
if(!$response->getHeader('X-Controller')) $response->addHeader('X-Controller', $this->class);
|
if(!$response->getHeader('X-Controller')) $response->addHeader('X-Controller', $this->class);
|
||||||
if(!$response->getHeader('X-Title')) $response->addHeader('X-Title', $title);
|
if(!$response->getHeader('X-Title')) $response->addHeader('X-Title', $title);
|
||||||
if(!$response->getHeader('X-ControllerURL')) $response->addHeader('X-ControllerURL', $request->getURL());
|
if(!$response->getHeader('X-ControllerURL')) {
|
||||||
|
$url = $request->getURL();
|
||||||
|
if($getVars = $request->getVars()) {
|
||||||
|
if(isset($getVars['url'])) unset($getVars['url']);
|
||||||
|
$url = Controller::join_links($url, '?' . http_build_query($getVars));
|
||||||
|
}
|
||||||
|
$response->addHeader('X-ControllerURL', $url);
|
||||||
|
}
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user