Merge pull request #10456 from creative-commoners/pulls/5/rescue-master-remove-unsafe-queryparams

API Rescue Master Branch PR: Remove isDev / isTest querystring arguments
This commit is contained in:
Steve Boyd 2022-08-24 15:14:45 +12:00 committed by GitHub
commit 4a3b6d951b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 28 deletions

View File

@ -257,12 +257,6 @@ abstract class BaseKernel implements Kernel
return $this->enviroment;
}
// Check saved session
$env = $this->sessionEnvironment();
if ($env) {
return $env;
}
// Check getenv
if ($env = Environment::getEnv('SS_ENVIRONMENT_TYPE')) {
return $env;
@ -271,23 +265,6 @@ abstract class BaseKernel implements Kernel
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();

View File

@ -53,10 +53,7 @@ class ErrorControlChainMiddleware implements HTTPMiddleware
{
$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;
}

View File

@ -129,7 +129,6 @@ class ParameterConfirmationToken extends AbstractConfirmationToken
public function suppress()
{
unset($_GET[$this->parameterName]);
$this->request->offsetUnset($this->parameterName);
}