Skip to content
This repository
Browse code

MINOR Including GET parameters in X-ControllerURL default headers (wh…

…ich fixes e.g. AssetAdmin search persistence)
  • Loading branch information...
commit 620b23a23ffc371bd62a654f340d261c8ff629e0 1 parent eecca9b
Ingo Schommer authored

Showing 1 changed file with 8 additions and 1 deletion. Show diff stats Hide diff stats

  1. 9  admin/code/LeftAndMain.php
9  admin/code/LeftAndMain.php
@@ -328,7 +328,14 @@ function handleRequest($request, DataModel $model) {
328 328
 		$response = parent::handleRequest($request, $model);
329 329
 		if(!$response->getHeader('X-Controller')) $response->addHeader('X-Controller', $this->class);
330 330
 		if(!$response->getHeader('X-Title')) $response->addHeader('X-Title', $title);
331  
-		if(!$response->getHeader('X-ControllerURL')) $response->addHeader('X-ControllerURL', $request->getURL());
  331
+		if(!$response->getHeader('X-ControllerURL')) {
  332
+			$url = $request->getURL();
  333
+			if($getVars = $request->getVars()) {
  334
+				if(isset($getVars['url'])) unset($getVars['url']);
  335
+				$url = Controller::join_links($url, '?' . http_build_query($getVars));
  336
+			}
  337
+			$response->addHeader('X-ControllerURL', $url);
  338
+		}
332 339
 		
333 340
 		return $response;
334 341
 	}

0 notes on commit 620b23a

Please sign in to comment.
Something went wrong with that request. Please try again.