Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{
"php": "^5.5|^7.0",
"psr/cache": "1.0.0",
"cache/taggable-cache": "^0.2"
"cache/taggable-cache": "^0.2|^0.3"
},
"require-dev":
{
Expand Down
15 changes: 3 additions & 12 deletions src/AbstractCachePool.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ abstract class AbstractCachePool implements CacheItemPoolInterface, TaggablePool
{
use TaggablePoolTrait;

/**
* List of invalid (or reserved) key characters.
*
* @type string
*/
const KEY_INVALID_CHARACTERS = '{}()/\@:';

/**
* @type CacheItemInterface[] deferred
*/
Expand Down Expand Up @@ -245,12 +238,10 @@ protected function validateKey($key)
));
}

$invalid = preg_quote(static::KEY_INVALID_CHARACTERS, '|');
if (preg_match('|['.$invalid.']|', $key)) {
if (preg_match('|[\{\}\(\)/\\@\:]|', $key)) {
throw new InvalidArgumentException(sprintf(
'Invalid key: "%s". The key contains one or more characters reserved for future extension: %s',
$key,
static::KEY_INVALID_CHARACTERS
'Invalid key: "%s". The key contains one or more characters reserved for future extension: {}()/\@:',
$key
));
}
}
Expand Down