Skip to content

Commit

Permalink
Merge pull request #10456 from creative-commoners/pulls/5/rescue-mast…
Browse files Browse the repository at this point in the history
…er-remove-unsafe-queryparams

API Rescue Master Branch PR: Remove isDev / isTest querystring arguments
  • Loading branch information
emteknetnz authored Aug 24, 2022
2 parents 3b758a8 + 08d1cd3 commit 4a3b6d9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 28 deletions.
23 changes: 0 additions & 23 deletions src/Core/BaseKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,6 @@ public function getEnvironment()
return $this->enviroment;
}

// Check saved session
$env = $this->sessionEnvironment();
if ($env) {
return $env;
}

// Check getenv
if ($env = Environment::getEnv('SS_ENVIRONMENT_TYPE')) {
return $env;
Expand All @@ -271,23 +265,6 @@ public function getEnvironment()
return self::LIVE;
}

/**
* Check or update any temporary environment specified in the session.
*
* @return null|string
*
* @deprecated 5.0 Use Director::get_session_environment_type() instead
*/
protected function sessionEnvironment()
{
if (!$this->booted) {
// session is not initialyzed yet, neither is manifest
return null;
}

return Director::get_session_environment_type();
}

abstract public function boot($flush = false);

abstract public function isFlushed();
Expand Down
5 changes: 1 addition & 4 deletions src/Core/Startup/ErrorControlChainMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ protected function prepareConfirmationTokenChain(HTTPRequest $request)
{
$chain = new ConfirmationTokenChain();
$chain->pushToken(new URLConfirmationToken('dev/build', $request));

foreach (['isTest', 'isDev', 'flush'] as $parameter) {
$chain->pushToken(new ParameterConfirmationToken($parameter, $request));
}
$chain->pushToken(new ParameterConfirmationToken('flush', $request));

return $chain;
}
Expand Down
1 change: 0 additions & 1 deletion src/Core/Startup/ParameterConfirmationToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ public function reloadRequiredIfError()

public function suppress()
{
unset($_GET[$this->parameterName]);
$this->request->offsetUnset($this->parameterName);
}

Expand Down

0 comments on commit 4a3b6d9

Please sign in to comment.