get rid of all mysterious numbers that meant length of string literals

This commit is contained in:
Andrzej Rybczak
2009-09-15 23:12:45 +00:00
parent 6e903f9fc8
commit 61a9d6a785
4 changed files with 18 additions and 13 deletions

View File

@@ -204,11 +204,11 @@ void EscapeHtml(std::string &s)
s.replace(i, j-i, "");
}
for (size_t i = s.find("'"); i != std::string::npos; i = s.find("'"))
s.replace(i, 6, "'");
s.replace(i, static_strlen("'"), "'");
for (size_t i = s.find("""); i != std::string::npos; i = s.find("""))
s.replace(i, 6, "\"");
s.replace(i, static_strlen("""), "\"");
for (size_t i = s.find("&"); i != std::string::npos; i = s.find("&"))
s.replace(i, 5, "&");
s.replace(i, static_strlen("&"), "&");
for (size_t i = 0; i < s.length(); ++i)
{
if (erase)