Commit 40a7440d authored by alexpott's avatar alexpott

Issue #2352207 by martin107, Berdir: Database cache backend does not treat cid as case sensitive

parent 8415e434
......@@ -14,6 +14,8 @@
* Drupal\Core\Cache\DatabaseBackend provides the default implementation, which
* can be consulted as an example.
*
* The cache indentifiers are case sensitive.
*
* @ingroup cache
*/
interface CacheBackendInterface {
......
......@@ -564,6 +564,7 @@ public function schemaDefinition() {
'length' => 255,
'not null' => TRUE,
'default' => '',
'binary' => TRUE,
),
'data' => array(
'description' => 'A collection of data to cache.',
......
......@@ -213,6 +213,11 @@ public function testSetGet() {
$backend->set($cid, 'test');
$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.
try {
$backend->set('exception_test', 'value', Cache::PERMANENT, ['node' => [3, 5, 7]]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment