Skip to content
Closed
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
4 changes: 2 additions & 2 deletions system/Cache/Handlers/BaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public static function validateKey($key, $prefix = ''): string
{
throw new InvalidArgumentException('Cache key cannot be empty.');
}
if (strpbrk($key, self::RESERVED_CHARACTERS) !== false)
if (strpbrk($key, static::RESERVED_CHARACTERS) !== false)
{
throw new InvalidArgumentException('Cache key contains reserved characters ' . self::RESERVED_CHARACTERS);
throw new InvalidArgumentException('Cache key contains reserved characters ' . static::RESERVED_CHARACTERS);
}

// If the key with prefix exceeds the length then return the hashed version
Expand Down
6 changes: 6 additions & 0 deletions system/Cache/Handlers/FileHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
*/
class FileHandler extends BaseHandler
{
/**
* Reserved characters that cannot be used in a key or tag.
* From https://github.com/symfony/cache-contracts/blob/c0446463729b89dd4fa62e9aeecc80287323615d/ItemInterface.php#L43
*/
public const RESERVED_CHARACTERS = '{}()\@:';

/**
* Maximum key length.
*
Expand Down