Merged revisions 52119 via svnmerge from

http://svn.silverstripe.com/open/modules/sapphire/branches/govtsecurity

........
  r52119 | sminnee | 2008-04-03 21:38:21 +1300 (Thu, 03 Apr 2008) | 1 line
  
  Improved operation of Director::test() when accessing ,,, directly.
........


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@53463 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-04-26 06:31:24 +00:00
parent f8589c9677
commit 7759de7433

View File

@ -134,6 +134,16 @@ class Director {
parse_str($getVarsEncoded, $getVars);
}
$existingRequestVars = $_REQUEST;
$existingGetVars = $_GET;
$existingPostVars = $_POST;
$existingSessionVars = $_SESSION;
$_REQUEST = array_merge((array)$getVars, (array)$post);
$_GET = (array)$getVars;
$_POST = (array)$post;
$_SESSION = $session ? $session->inst_getAll() : array();
$controllerObj = Director::getControllerForURL($url);
// Load the session into the controller
@ -144,6 +154,10 @@ class Director {
} else if($controllerObj) {
$response = $controllerObj->run( array_merge($getVars, (array)$post) );
$_REQUEST = $existingRequestVars;
$_GET = $existingGetVars;
$_POST = $existingPostVars;
$_SESSION = $existingSessionVars;
return $response;
}
}