summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-04-29 13:17:41 +0200
committerRobin Appelman <icewind@owncloud.com>2016-04-29 13:17:41 +0200
commitd850a764eb455b6bf42185976d2147e627954ecf (patch)
tree95269e960ef16f038f3929424f878cc23eed9ce0
parent5b45f0f91448f109ff33d4fb03368a0405e1da10 (diff)
downloadnextcloud-server-d850a764eb455b6bf42185976d2147e627954ecf.tar.gz
nextcloud-server-d850a764eb455b6bf42185976d2147e627954ecf.zip
cap the normalized path cache
-rw-r--r--lib/private/Files/Filesystem.php7
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