do not prefix empty path with preprocessor script, as it prevents client-side expansion

This commit is contained in:
ralf 2022-03-23 20:57:00 +02:00
parent d13d039349
commit a5d6fea958

View File

@ -208,10 +208,14 @@ class Template extends Etemplate\Widget
* This adds the server-side modification of eTemplates for web-components /api/etemplate.php. * This adds the server-side modification of eTemplates for web-components /api/etemplate.php.
* *
* @param string $path * @param string $path
* @return string url * @return string|null url
*/ */
public static function rel2url($path) public static function rel2url($path)
{ {
if (empty($path))
{
return null; // do not prefix empty path with preprocessor script, as it prevents client-side expansion
}
return $GLOBALS['egw_info']['server']['webserver_url'].'/api/etemplate.php'. return $GLOBALS['egw_info']['server']['webserver_url'].'/api/etemplate.php'.
($path[0] === '/' ? $path : preg_replace('#^'.self::VFS_TEMPLATE_PATH.'#', '', ($path[0] === '/' ? $path : preg_replace('#^'.self::VFS_TEMPLATE_PATH.'#', '',
Api\Vfs::parse_url($path, PHP_URL_PATH))).'?'. Api\Vfs::parse_url($path, PHP_URL_PATH))).'?'.