mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX #3219: dev/buildcache showing up in static links
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@69830 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
eecda158c3
commit
4adc1943ce
@ -159,6 +159,7 @@ class Director {
|
|||||||
|
|
||||||
if(!$httpMethod) $httpMethod = ($postVars || is_array($postVars)) ? "POST" : "GET";
|
if(!$httpMethod) $httpMethod = ($postVars || is_array($postVars)) ? "POST" : "GET";
|
||||||
|
|
||||||
|
$urlWithQuerystring = $url;
|
||||||
if(strpos($url, '?') !== false) {
|
if(strpos($url, '?') !== false) {
|
||||||
list($url, $getVarsEncoded) = explode('?', $url, 2);
|
list($url, $getVarsEncoded) = explode('?', $url, 2);
|
||||||
parse_str($getVarsEncoded, $getVars);
|
parse_str($getVarsEncoded, $getVars);
|
||||||
@ -172,11 +173,11 @@ class Director {
|
|||||||
$existingPostVars = $_POST;
|
$existingPostVars = $_POST;
|
||||||
$existingSessionVars = $_SESSION;
|
$existingSessionVars = $_SESSION;
|
||||||
$existingCookies = $_COOKIE;
|
$existingCookies = $_COOKIE;
|
||||||
|
$existingServer = $_SERVER;
|
||||||
$existingCookieReportErrors = Cookie::report_errors();
|
$existingCookieReportErrors = Cookie::report_errors();
|
||||||
Cookie::set_report_errors(false);
|
|
||||||
|
|
||||||
$existingRequirementsBackend = Requirements::backend();
|
$existingRequirementsBackend = Requirements::backend();
|
||||||
|
|
||||||
|
Cookie::set_report_errors(false);
|
||||||
Requirements::set_backend(new Requirements_Backend());
|
Requirements::set_backend(new Requirements_Backend());
|
||||||
|
|
||||||
// Replace the superglobals with appropriate test values
|
// Replace the superglobals with appropriate test values
|
||||||
@ -185,6 +186,7 @@ class Director {
|
|||||||
$_POST = (array)$postVars;
|
$_POST = (array)$postVars;
|
||||||
$_SESSION = $session ? $session->inst_getAll() : array();
|
$_SESSION = $session ? $session->inst_getAll() : array();
|
||||||
$_COOKIE = array();
|
$_COOKIE = array();
|
||||||
|
$_SERVER['REQUEST_URI'] = Director::baseURL() . $urlWithQuerystring;
|
||||||
|
|
||||||
$req = new HTTPRequest($httpMethod, $url, $getVars, $postVars, $body);
|
$req = new HTTPRequest($httpMethod, $url, $getVars, $postVars, $body);
|
||||||
if($headers) foreach($headers as $k => $v) $req->addHeader($k, $v);
|
if($headers) foreach($headers as $k => $v) $req->addHeader($k, $v);
|
||||||
@ -196,6 +198,8 @@ class Director {
|
|||||||
$_POST = $existingPostVars;
|
$_POST = $existingPostVars;
|
||||||
$_SESSION = $existingSessionVars;
|
$_SESSION = $existingSessionVars;
|
||||||
$_COOKIE = $existingCookies;
|
$_COOKIE = $existingCookies;
|
||||||
|
$_SERVER = $existingServer;
|
||||||
|
|
||||||
Cookie::set_report_errors($existingCookieReportErrors);
|
Cookie::set_report_errors($existingCookieReportErrors);
|
||||||
Requirements::set_backend($existingRequirementsBackend);
|
Requirements::set_backend($existingRequirementsBackend);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user