mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Added option to disable SimpleCache key validation
This commit is contained in:
parent
424da520cf
commit
ef55e7d219
|
|
@ -4,6 +4,7 @@
|
|||
1. [](#new)
|
||||
* Added `Uri::method()` to get current HTTP method (GET/POST etc)
|
||||
* `FormatterInterface`: Added `getSupportedFileExtensions()` and `getDefaultFileExtension()` methods
|
||||
* Added option to disable `SimpleCache` key validation
|
||||
1. [](#improved)
|
||||
* Improved `Utils::url()` to support query strings
|
||||
1. [](#bugfix)
|
||||
|
|
|
|||
|
|
@ -16,21 +16,18 @@ use Grav\Framework\Cache\Exception\InvalidArgumentException;
|
|||
*/
|
||||
trait CacheTrait
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
private $namespace = '';
|
||||
|
||||
/**
|
||||
* @var int|null
|
||||
*/
|
||||
/** @var int|null */
|
||||
private $defaultLifetime = null;
|
||||
|
||||
/**
|
||||
* @var \stdClass
|
||||
*/
|
||||
/** @var \stdClass */
|
||||
private $miss;
|
||||
|
||||
/** @var bool */
|
||||
private $validation = true;
|
||||
|
||||
/**
|
||||
* Always call from constructor.
|
||||
*
|
||||
|
|
@ -45,6 +42,14 @@ trait CacheTrait
|
|||
$this->miss = new \stdClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $validation
|
||||
*/
|
||||
public function setValidation($validation)
|
||||
{
|
||||
$this->validation = (bool) $validation;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
|
@ -307,6 +312,10 @@ trait CacheTrait
|
|||
*/
|
||||
protected function validateKeys($keys)
|
||||
{
|
||||
if (!$this->validation) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($keys as $key) {
|
||||
$this->validateKey($key);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user