mirror of
https://github.com/friendica/friendica
synced 2025-04-26 15:50:10 +00:00
Convert potential spaces in Memcache(d) key names
- Address https://github.com/friendica/friendica/issues/11630#issuecomment-1166475036 - Add test for space in cache keys
This commit is contained in:
parent
c9d829a679
commit
91f5a7cc6b
4 changed files with 32 additions and 1 deletions
|
@ -68,6 +68,17 @@ class MemcacheCache extends AbstractCache implements ICanCacheInMemory
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Memcache doesn't allow spaces in keys
|
||||
*
|
||||
* @param string $key
|
||||
* @return string
|
||||
*/
|
||||
protected function getCacheKey(string $key): string
|
||||
{
|
||||
return str_replace(' ', '_', parent::getCacheKey($key));
|
||||
}
|
||||
|
||||
/**
|
||||
* (@inheritdoc)
|
||||
*/
|
||||
|
|
|
@ -93,6 +93,17 @@ class MemcachedCache extends AbstractCache implements ICanCacheInMemory
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Memcached doesn't allow spaces in keys
|
||||
*
|
||||
* @param string $key
|
||||
* @return string
|
||||
*/
|
||||
protected function getCacheKey(string $key): string
|
||||
{
|
||||
return str_replace(' ', '_', parent::getCacheKey($key));
|
||||
}
|
||||
|
||||
/**
|
||||
* (@inheritdoc)
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue