deals with some rows share_path have "vfs://default" prefix, some are just path

This commit is contained in:
Ralf Becker 2020-03-06 15:08:34 +01:00
parent 4c987e7dd8
commit 4fe466f4f9
2 changed files with 5 additions and 1 deletions

View File

@ -794,7 +794,6 @@ class Sharing
} }
// Now check the remaining shares // 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(); static::cleanup_missing_paths();
} }
catch (\Exception $e) { catch (\Exception $e) {

View File

@ -339,6 +339,11 @@ class Sharing extends \EGroupware\Api\Sharing
*/ */
protected static function check_path($share) 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']); return Vfs::file_exists($share['share_path']);
} }