Issue #2352207 by martin107, Berdir: Database cache backend does not treat cid as case sensitive
parent
8415e43451
commit
40a7440d6b
|
@ -14,6 +14,8 @@ namespace Drupal\Core\Cache;
|
||||||
* Drupal\Core\Cache\DatabaseBackend provides the default implementation, which
|
* Drupal\Core\Cache\DatabaseBackend provides the default implementation, which
|
||||||
* can be consulted as an example.
|
* can be consulted as an example.
|
||||||
*
|
*
|
||||||
|
* The cache indentifiers are case sensitive.
|
||||||
|
*
|
||||||
* @ingroup cache
|
* @ingroup cache
|
||||||
*/
|
*/
|
||||||
interface CacheBackendInterface {
|
interface CacheBackendInterface {
|
||||||
|
|
|
@ -564,6 +564,7 @@ class DatabaseBackend implements CacheBackendInterface {
|
||||||
'length' => 255,
|
'length' => 255,
|
||||||
'not null' => TRUE,
|
'not null' => TRUE,
|
||||||
'default' => '',
|
'default' => '',
|
||||||
|
'binary' => TRUE,
|
||||||
),
|
),
|
||||||
'data' => array(
|
'data' => array(
|
||||||
'description' => 'A collection of data to cache.',
|
'description' => 'A collection of data to cache.',
|
||||||
|
|
|
@ -213,6 +213,11 @@ abstract class GenericCacheBackendUnitTestBase extends DrupalUnitTestBase {
|
||||||
$backend->set($cid, 'test');
|
$backend->set($cid, 'test');
|
||||||
$this->assertEqual('test', $backend->get($cid)->data);
|
$this->assertEqual('test', $backend->get($cid)->data);
|
||||||
|
|
||||||
|
// Check that the cache key is case sensitive.
|
||||||
|
$backend->set('TEST8', 'value');
|
||||||
|
$this->assertEqual('value', $backend->get('TEST8')->data);
|
||||||
|
$this->assertFalse($backend->get('test8'));
|
||||||
|
|
||||||
// Calling ::set() with invalid cache tags.
|
// Calling ::set() with invalid cache tags.
|
||||||
try {
|
try {
|
||||||
$backend->set('exception_test', 'value', Cache::PERMANENT, ['node' => [3, 5, 7]]);
|
$backend->set('exception_test', 'value', Cache::PERMANENT, ['node' => [3, 5, 7]]);
|
||||||
|
|
Loading…
Reference in New Issue