diff options
author | Robin McCorkell <rmccorkell@karoshi.org.uk> | 2015-03-07 00:12:46 +0000 |
---|---|---|
committer | Robin McCorkell <rmccorkell@karoshi.org.uk> | 2015-07-20 16:27:26 +0100 |
commit | 75a5e6e12b18a9f5b7b113cd7e2c9c56c204084d (patch) | |
tree | 51a9ba575f69fddc99f34a8cc611f7dd716c1554 /lib | |
parent | df19cabb44f9106484290a269ef6d4cb07b059d7 (diff) | |
download | nextcloud-server-75a5e6e12b18a9f5b7b113cd7e2c9c56c204084d.tar.gz nextcloud-server-75a5e6e12b18a9f5b7b113cd7e2c9c56c204084d.zip |
Fix mounting wrapped storages resulting in many-layered wrapping
This usually doesn't cause issues, but in unit tests sometimes a wrapped
storage is passed to Filesystem::mount() and gets rewrapped, hitting the
XDebug function nesting level limit when used.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/mount/mountpoint.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/files/mount/mountpoint.php b/lib/private/files/mount/mountpoint.php index 2871bbd9083..5e4949aa9dd 100644 --- a/lib/private/files/mount/mountpoint.php +++ b/lib/private/files/mount/mountpoint.php @@ -29,6 +29,7 @@ namespace OC\Files\Mount; use \OC\Files\Filesystem; use OC\Files\Storage\StorageFactory; use OC\Files\Storage\Storage; +use OC\Files\Storage\Wrapper\Wrapper; use OCP\Files\Mount\IMountPoint; class MountPoint implements IMountPoint { @@ -92,7 +93,11 @@ class MountPoint implements IMountPoint { $this->mountPoint = $mountpoint; if ($storage instanceof Storage) { $this->class = get_class($storage); - $this->storage = $this->loader->wrap($this, $storage); + $this->storage = $storage; + // only wrap if not already wrapped + if (!($this->storage instanceof Wrapper)) { + $this->storage = $this->loader->wrap($this, $this->storage); + } } else { // Update old classes to new namespace if (strpos($storage, 'OC_Filestorage_') !== false) { |