Fix <style> and <script> erasure.

I didn't take into account that <script […]/> is possible.
This commit is contained in:
tastytea 2021-06-06 16:06:14 +02:00
parent 262aab6671
commit a49c500d0f
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 4 additions and 1 deletions

View File

@ -165,7 +165,10 @@ void cleanup_text(string &text)
else if (text.substr(pos, 7) == "<style "
|| text.substr(pos, 8) == "<script ")
{
pos = text.find('>', pos) + 1;
if (text.find("/>", pos) > endpos)
{
endpos = text.find('>', endpos) + 1;
}
}
DEBUGLOG << "Replacing '" << text.substr(pos, endpos - pos)