diff --git a/api/etemplate.php b/api/etemplate.php index bcae146a4e..6753f04adc 100644 --- a/api/etemplate.php +++ b/api/etemplate.php @@ -65,7 +65,9 @@ function send_template() elseif(($str = file_get_contents($path)) !== false) { // replace single quote enclosing attribute values with double quotes - $str = preg_replace("#([a-z_-]+)='([^']*)'([ />])#i", '$1="$2"$3', $str); + $str = preg_replace_callback("#([a-z_-]+)='([^']*)'([ />])#i", static function($matches){ + return $matches[1].'="'.str_replace('"', '"', $matches[2]).'"'.$matches[3]; + }, $str); // fix -->