diff --git a/api/etemplate.php b/api/etemplate.php index 320d517beb..4887831ca6 100644 --- a/api/etemplate.php +++ b/api/etemplate.php @@ -67,7 +67,7 @@ function send_template() $str = preg_replace('#]*)>[\r\n\s]*]+>)[\r\n\s]*#', ']* (options="([^"]+)")[ />]#', static function($matches) + $str = preg_replace_callback('#<([^- />]+)(-[^ ]+)?[^>]* (options="([^"]+)")[ />]#', static function($matches) { // take care of (static) type attribute, if used if (preg_match('/ type="([a-z-]+)"/', $matches[0], $type)) @@ -116,6 +116,17 @@ function send_template() return $matches[0]; }, $str); + // 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 -->