From d850a764eb455b6bf42185976d2147e627954ecf Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Apr 2016 13:17:41 +0200 Subject: [PATCH] cap the normalized path cache --- lib/private/Files/Filesystem.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php index 7283c815c973..7cd1f56071ca 100644 --- a/lib/private/Files/Filesystem.php +++ b/lib/private/Files/Filesystem.php @@ -58,6 +58,7 @@ namespace OC\Files; +use OC\Cache\CappedMemoryCache; use OC\Files\Config\MountProviderCollection; use OC\Files\Mount\MountPoint; use OC\Files\Storage\StorageFactory; @@ -81,7 +82,7 @@ class Filesystem { static private $usersSetup = array(); - static private $normalizedPathCache = array(); + static private $normalizedPathCache = null; static private $listeningForProviders = false; @@ -794,6 +795,10 @@ static public function hasUpdated($path, $time) { * @return string */ public static function normalizePath($path, $stripTrailingSlash = true, $isAbsolutePath = false) { + if (is_null(self::$normalizedPathCache)) { + self::$normalizedPathCache = new CappedMemoryCache(); + } + /** * FIXME: This is a workaround for existing classes and files which call * this function with another type than a valid string. This