diff --git a/api/etemplate.php b/api/etemplate.php index 227ecbe8db..88fd0034d4 100644 --- a/api/etemplate.php +++ b/api/etemplate.php @@ -13,8 +13,8 @@ use EGroupware\Api; // add et2- prefix to following widgets/tags -const ADD_ET2_PREFIX_REGEXP = '#<((/?)([vh]?box|textbox|textarea|button|colorpicker|description|image|url(-email|-phone|-fax)?))(/?|\s[^>]*)>#m'; -const ADD_ET2_PREFIX_LAST_GROUP = 5; +const ADD_ET2_PREFIX_REGEXP = '#<((/?)([vh]?box|date(-time[^\s]*|-duration)?|textbox|textarea|button|colorpicker|description|image|url(-email|-phone|-fax)?))(/?|\s[^>]*)>#m'; +const ADD_ET2_PREFIX_LAST_GROUP = 6; // switch evtl. set output-compression off, as we cant calculate a Content-Length header with transparent compression ini_set('zlib.output_compression', 0); @@ -52,201 +52,198 @@ function send_template() http_response_code(404); exit; } - /* disable caching for now, as you need to delete the cache, once you change ADD_ET2_PREFIX_REGEXP - $cache = $GLOBALS['egw_info']['server']['temp_dir'].'/egw_cache/eT2-Cache-'.$GLOBALS['egw_info']['server']['install_id'].$_SERVER['PATH_INFO']; - if (file_exists($cache) && filemtime($cache) > filemtime($path) && + $cache = $GLOBALS['egw_info']['server']['temp_dir'].'/egw_cache/eT2-Cache-'. + $GLOBALS['egw_info']['server']['install_id'].'-'.str_replace('/', '-', $_SERVER['PATH_INFO']); + if (file_exists($cache) && filemtime($cache) > max(filemtime($path), filemtime(__FILE__)) && ($str = file_get_contents($cache)) !== false) { $cache_read = microtime(true); } - else*/ - if(($str = file_get_contents($path)) !== false && - // eTemplate marked as legacy, return unchanged template without web-components / et2-prefix - !preg_match('/]* legacy="true"/', $str)) + elseif(($str = file_get_contents($path)) !== false) { // fix -->