From f29a2b5ea8a019763ec6395da9a4427fe50fe200 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 11 Oct 2021 14:02:46 +0200 Subject: [PATCH] fix PHP Warning: Illegal string offset 'tmp_name' --- api/src/Etemplate/Widget/Vfs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/Etemplate/Widget/Vfs.php b/api/src/Etemplate/Widget/Vfs.php index f378538697..d04e8b96cc 100644 --- a/api/src/Etemplate/Widget/Vfs.php +++ b/api/src/Etemplate/Widget/Vfs.php @@ -226,7 +226,7 @@ class Vfs extends File foreach($links as $link) { $matches = null; - if (is_array($link) && preg_match('|^'.preg_quote(Api\Vfs::PREFIX,'|').'('.preg_quote(self::get_temp_dir($app, ''), '|').'[^/]+)/|', $link['id']['tmp_name'], $matches)) + if (is_array($link) && !empty($link['id']['tmp_name']) && preg_match('|^'.preg_quote(Api\Vfs::PREFIX,'|').'('.preg_quote(self::get_temp_dir($app, ''), '|').'[^/]+)/|', $link['id']['tmp_name'], $matches)) { $replace[substr($link['id']['tmp_name'], strlen(Api\Vfs::PREFIX))] = Api\Link::vfs_path($app, $id, Api\Vfs::basename($link['id']['tmp_name']), true);