conv: prevent StripHtmlTags from falling into infinite loop

malformed tags could cause this, e.g. ../span><br>..,
position of < would be the same as >, nothing would be actually
removed and the operation would be performed ad infinitum.
This commit is contained in:
Andrzej Rybczak
2010-12-30 19:13:42 +01:00
parent 735faa75b9
commit 192a90a5be

View File

@@ -279,7 +279,7 @@ void StripHtmlTags(std::string &s)
bool erase = 0;
for (size_t i = s.find("<"); i != std::string::npos; i = s.find("<"))
{
size_t j = s.find(">")+1;
size_t j = s.find(">", i)+1;
s.replace(i, j-i, "");
}
Replace(s, "&#039;", "'");