]> source.dussan.org Git - nextcloud-server.git/commitdiff
hash the path used for the cache key to prevent key length problems 3214/head
authorRobin Appelman <robin@icewind.nl>
Tue, 24 Jan 2017 10:18:05 +0000 (11:18 +0100)
committerRobin Appelman <robin@icewind.nl>
Tue, 24 Jan 2017 10:18:05 +0000 (11:18 +0100)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/legacy/helper.php

index 9f3cf8ea69d347b3e5ccc3938fcd2c57e25ce4e3..dfe2e09afff4ebfd5b000a5f32ed000739eac2e9 100644 (file)
@@ -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,