From 4fe466f4f92cfb44e749b230be7082ce5537829c Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 6 Mar 2020 15:08:34 +0100 Subject: [PATCH] deals with some rows share_path have "vfs://default" prefix, some are just path --- api/src/Sharing.php | 1 - api/src/Vfs/Sharing.php | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/api/src/Sharing.php b/api/src/Sharing.php index 792779e9e8..e1e5b997fc 100644 --- a/api/src/Sharing.php +++ b/api/src/Sharing.php @@ -794,7 +794,6 @@ class Sharing } // Now check the remaining shares - /* temporary disabled, as the check does not correctly check user permissions nor account for pathes without vfs prefix*/ static::cleanup_missing_paths(); } catch (\Exception $e) { diff --git a/api/src/Vfs/Sharing.php b/api/src/Vfs/Sharing.php index 79aac5707e..3a89043dc6 100644 --- a/api/src/Vfs/Sharing.php +++ b/api/src/Vfs/Sharing.php @@ -339,6 +339,11 @@ class Sharing extends \EGroupware\Api\Sharing */ protected static function check_path($share) { + // remove VFS::PREFIX (vfs://default), as Vfs::file_exists returns false if path does NOT start with a / + if ($share['share_path'][0] !== '/') + { + $share['share_path'] = Api\Vfs::parse_url($share['share_path'], PHP_URL_PATH); + } return Vfs::file_exists($share['share_path']); }