From 357e5a33265ef5804b4b9189ce2ea4f6e720be1a Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 12 Mar 2018 13:50:37 -0600 Subject: [PATCH] Re-init static streamwrapper, as some of them look at permissions or preferences --- api/src/Vfs/Sharing.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/src/Vfs/Sharing.php b/api/src/Vfs/Sharing.php index e1823d2a15..4bbbcb0550 100644 --- a/api/src/Vfs/Sharing.php +++ b/api/src/Vfs/Sharing.php @@ -239,6 +239,14 @@ class Sharing $share['share_root'] = '/'; Vfs::$user = $share['share_owner']; + + // Need to re-init stream wrapper, as some of them look at + // preferences or permissions + $scheme = Vfs\StreamWrapper::scheme2class(Vfs::parse_url($share['resolve_url'],PHP_URL_SCHEME)); + if($scheme && method_exists($scheme, 'init_static')) + { + $scheme::init_static(); + } } // mounting share