add missing $relpath

This commit is contained in:
Ralf Becker 2022-02-03 15:39:33 +02:00 committed by Hadi Nategh
parent 6490e4360f
commit 3d53fa9d97

View File

@ -79,12 +79,14 @@ class Vfs extends File
/** /**
* Find all attachments, can be used to prepare the data for the widget on client-side * Find all attachments, can be used to prepare the data for the widget on client-side
* *
* @param string $path eg. "/apps/$app/$id/$rel_path" * @param string $path eg. "/apps/$app/$id/$relpath"
* @return array * @return array
* @throws Api\Exception\AssertionFailed * @throws Api\Exception\AssertionFailed
*/ */
public static function findAttachments($path) public static function findAttachments($path)
{ {
list(,,,, $relpath) = explode('/', $path, 5);
$value = []; $value = [];
// Single file, already existing // Single file, already existing
if (substr($path,-1) != '/' && Api\Vfs::file_exists($path) && !Api\Vfs::is_dir($path)) if (substr($path,-1) != '/' && Api\Vfs::file_exists($path) && !Api\Vfs::is_dir($path))