diff --git a/api/etemplate.php b/api/etemplate.php index 4f6917fa3e..4b079ec5a4 100644 --- a/api/etemplate.php +++ b/api/etemplate.php @@ -13,11 +13,12 @@ use EGroupware\Api; // add et2- prefix to following widgets/tags, if NO <]*)expose_view="true"\s([^><]*)\\/>/', '', $str); + // fix --> + $str = preg_replace('##', '', $str); + + // fix <(textbox|int(eger)?|float) precision="int(eger)?|float" .../> --> or + $str = preg_replace_callback('#<(textbox|int(eger)?|float|number).*?\s(type="(int(eger)?|float)")?.*?(/|>#', + static function ($matches) + { + if ($matches[1] === 'textbox' && !in_array($matches[4], ['float', 'int', 'integer'], true)) + { + return ''; // regular textbox --> nothing to do + } + $type = $matches[1] === 'float' || $matches[4] === 'float' ? 'float' : 'int'; + $tag = str_replace('<' . $matches[1], ''; + }, $str); + // modify <(vfs-mime|link-string|link-list) --> ', + $str = preg_replace(ADD_ET2_PREFIX_LEGACY_REGEXP, '', str_replace('', '', $str)); // change link attribute only_app to et2-link attribute app and map r/o link-entry to link @@ -278,33 +297,6 @@ function send_template() } else { - // fix deprecated attributes: needed, blur, ... - static $deprecated = [ - 'needed' => 'required', - 'blur' => 'placeholder', - ]; - $str = preg_replace_callback('#<[^ ]+[^>]* (' . implode('|', array_keys($deprecated)) . ')="([^"]+)"[ />]#', - static function ($matches) use ($deprecated) { - return str_replace($matches[1] . '="', $deprecated[$matches[1]] . '="', $matches[0]); - }, $str); - - // fix -->