diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-04-29 15:22:06 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-04-29 15:22:06 +0200 |
commit | daf5f793a472b03e67e7f96b29367b544694645d (patch) | |
tree | 85e7a2edf757496703aea7302a70c0e5852a38cb | |
parent | 66ebc2ee6fe09e1e8419f4b399cd2c7c155d533e (diff) | |
parent | d850a764eb455b6bf42185976d2147e627954ecf (diff) | |
download | nextcloud-server-daf5f793a472b03e67e7f96b29367b544694645d.tar.gz nextcloud-server-daf5f793a472b03e67e7f96b29367b544694645d.zip |
Merge pull request #24351 from owncloud/capped-normalized-cache
cap the normalized path cache
-rw-r--r-- | lib/private/Files/Filesystem.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php index 7283c815c97..7cd1f56071c 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 @@ class Filesystem { * @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 |