HTML outside the head or body is too dangerous to include

This commit is contained in:
Jamie Cameron
2017-04-19 18:41:09 -07:00
parent eaf63ebc48
commit 77e6bc2a00

View File

@@ -2287,10 +2287,10 @@ sub safe_html
{
local $html = $_[0];
local $bodystuff;
if ($html =~ s/^([\000-\377]*?)<BODY([^>]*)>/$1/i) {
if ($html =~ s/^[\000-\377]*?<BODY([^>]*)>//i) {
$bodystuff = $1;
}
$html =~ s/<\/BODY>([\000-\377]*)$/$1/i;
$html =~ s/<\/BODY>[\000-\377]*$//i;
$html =~ s/<base[^>]*>//i;
$html = &filter_javascript($html);
$html = &safe_urls($html);