aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/helper.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-01-24 11:18:05 +0100
committerRobin Appelman <robin@icewind.nl>2017-01-24 11:18:05 +0100
commitcbc18b7c8ba000beed3ff4d7e7d8384c2601e54e (patch)
treea9a05f1aded48d7a47e69d14db44e975a8f27bda /lib/private/legacy/helper.php
parente38a9786232573218cd862d3483f8465d1d01fd9 (diff)
downloadnextcloud-server-cbc18b7c8ba000beed3ff4d7e7d8384c2601e54e.tar.gz
nextcloud-server-cbc18b7c8ba000beed3ff4d7e7d8384c2601e54e.zip
hash the path used for the cache key to prevent key length problems
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/legacy/helper.php')
-rw-r--r--lib/private/legacy/helper.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/legacy/helper.php b/lib/private/legacy/helper.php
index 9f3cf8ea69d..dfe2e09afff 100644
--- a/lib/private/legacy/helper.php
+++ b/lib/private/legacy/helper.php
@@ -541,7 +541,8 @@ class OC_Helper {
*/
public static function getStorageInfo($path, $rootInfo = null) {
$memcache = \OC::$server->getMemCacheFactory()->create('storageInfo');
- $cached = $memcache->get($rootInfo ? '__root__' : $path);
+ $cacheKey = $rootInfo ? '__root__' . md5($path) : md5($path);
+ $cached = $memcache->get($cacheKey);
if (is_array($cached)) {
return $cached;
}
@@ -613,7 +614,7 @@ class OC_Helper {
$ownerDisplayName = $owner->getDisplayName();
}
- $memcache->set($rootInfo ? '__root__' : $path, [
+ $memcache->set($cacheKey, [
'free' => $free,
'used' => $used,
'quota' => $quota,