mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-10 01:07:45 +01:00
Fixes #16028: Fix serialization of complex cache keys that contain non-UTF sequences
This commit is contained in:
committed by
Alexander Makarov
parent
2b79a0c5ba
commit
7d494d0d24
@@ -52,4 +52,24 @@ class ArrayCacheTest extends CacheTestCase
|
||||
static::$microtime++;
|
||||
$this->assertFalse($cache->get('expire_testa'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://github.com/yiisoft/yii2/issues/16028
|
||||
*/
|
||||
public function testSerializationOfComplexKeysThatContainNonUTFSequences()
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
|
||||
$firstCacheKey = $cache->buildKey([
|
||||
"First example of invalid UTF-8 sequence: \xF5",
|
||||
"Valid UTF-8 string",
|
||||
]);
|
||||
|
||||
$secondCacheKey = $cache->buildKey([
|
||||
"Second example of invalid UTF-8 sequence: \xF6",
|
||||
"Valid UTF-8 string",
|
||||
]);
|
||||
|
||||
$this->assertNotEquals($firstCacheKey, $secondCacheKey);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user