groupoffice
groupoffice copied to clipboard
SanitizeHTML CSS comment fixup
There is an odd case where css style contains a comment and isn't properly caught by the current code in go/base/util/StringHelper.php ~ line 908
you have this regex:
$html = preg_replace(["'<style>[\s]*<!--'u", "'-->[\s*]</style>'u"], ['<style>','</style>'], $html);
but I have seen cases where it's not enough and this following regex is more complete
$html = preg_replace(["'<style(\s*type=\"text/css\")?>[\s]*<!--'u", "'-->[\s*]</style>'u"], ['<style>','</style>'], $html);
or you could just match everything after style and up to the closing > tag