move code responsible for replacing content in strings to Replace()

This commit is contained in:
Andrzej Rybczak
2009-10-10 15:36:51 +02:00
parent 63fbdaae1f
commit f6f7a8a27e
5 changed files with 15 additions and 15 deletions

View File

@@ -199,12 +199,9 @@ void EscapeHtml(std::string &s)
size_t j = s.find(">")+1;
s.replace(i, j-i, "");
}
for (size_t i = s.find("'"); i != std::string::npos; i = s.find("'"))
s.replace(i, static_strlen("'"), "'");
for (size_t i = s.find("""); i != std::string::npos; i = s.find("""))
s.replace(i, static_strlen("""), "\"");
for (size_t i = s.find("&"); i != std::string::npos; i = s.find("&"))
s.replace(i, static_strlen("&"), "&");
Replace(s, "'", "'");
Replace(s, """, "\"");
Replace(s, "&", "&");
for (size_t i = 0; i < s.length(); ++i)
{
if (erase)