From ef1239b01790114adf8895abe47f7652d34ffd57 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 3 Sep 2021 11:02:06 +0200 Subject: [PATCH] fix URL if custom template from VFS is used --- api/src/Etemplate/Widget/Template.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/src/Etemplate/Widget/Template.php b/api/src/Etemplate/Widget/Template.php index 490eb6d591..b83255e7e9 100644 --- a/api/src/Etemplate/Widget/Template.php +++ b/api/src/Etemplate/Widget/Template.php @@ -213,7 +213,8 @@ class Template extends Etemplate\Widget public static function rel2url($path) { return $GLOBALS['egw_info']['server']['webserver_url'].'/api/etemplate.php'. - ($path[0] === '/' ? $path : Api\Vfs::parse_url($path, PHP_URL_PATH)).'?'.filemtime(self::rel2path($path)); + ($path[0] === '/' ? $path : preg_replace('#^'.self::VFS_TEMPLATE_PATH.'#', '', + Api\Vfs::parse_url($path, PHP_URL_PATH))).'?'.filemtime(self::rel2path($path)); } /** @@ -285,4 +286,4 @@ if ($GLOBALS['egw_info']['flags']['debug'] == 'etemplate_widget_template') header('Content-Type: text/xml'); echo $template->toXml(); } -*/ \ No newline at end of file +*/