Merge pull request #11581 from bancer/issue-11131-long-cache-key

Hash group cache keys to prevent key overflows in some cache engines
This commit is contained in:
Mark Story 2018-01-06 22:05:39 -05:00 committed by GitHub
commit ab272b09c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -181,7 +181,7 @@ abstract class CacheEngine {
$prefix = ''; $prefix = '';
if (!empty($this->_groupPrefix)) { if (!empty($this->_groupPrefix)) {
$prefix = vsprintf($this->_groupPrefix, $this->groups()); $prefix = md5(implode('_', $this->groups()));
} }
$key = preg_replace('/[\s]+/', '_', strtolower(trim(str_replace(array(DS, '/', '.'), '_', strval($key))))); $key = preg_replace('/[\s]+/', '_', strtolower(trim(str_replace(array(DS, '/', '.'), '_', strval($key)))));