conv: give function EscapeHtml much more appropriate name (StripHtmlTags)

This commit is contained in:
Andrzej Rybczak
2010-08-09 13:51:01 +02:00
parent 2eddb37497
commit 3b92484755
4 changed files with 6 additions and 6 deletions

View File

@@ -206,7 +206,7 @@ void EscapeUnallowedChars(std::string &s)
}
}
void EscapeHtml(std::string &s)
void StripHtmlTags(std::string &s)
{
bool erase = 0;
for (size_t i = s.find("<"); i != std::string::npos; i = s.find("<"))

View File

@@ -60,7 +60,7 @@ std::string Shorten(const std::basic_string<my_char_t> &s, size_t max_length);
void EscapeUnallowedChars(std::string &);
void EscapeHtml(std::string &s);
void StripHtmlTags(std::string &s);
void Trim(std::string &s);

View File

@@ -245,7 +245,7 @@ void *Info::PrepareArtist(void *screen_void_ptr)
if (a != std::string::npos)
{
EscapeHtml(result);
StripHtmlTags(result);
*screen->w << "Last.fm returned an error message: " << result;
ArtistReady = 1;
pthread_exit(0);
@@ -259,7 +259,7 @@ void *Info::PrepareArtist(void *screen_void_ptr)
result[j] = '.';
i += static_strlen("<name>");
similar.push_back(result.substr(i, j-i));
EscapeHtml(similar.back());
StripHtmlTags(similar.back());
}
std::vector<std::string> urls;
for (size_t i = result.find("<url>"); i != std::string::npos; i = result.find("<url>"))
@@ -299,7 +299,7 @@ void *Info::PrepareArtist(void *screen_void_ptr)
result = result.substr(a, b-a);
}
EscapeHtml(result);
StripHtmlTags(result);
Trim(result);
std::ostringstream filebuffer;

View File

@@ -87,7 +87,7 @@ bool LyricsFetcher::getContent(const char *open_tag, const char *close_tag, std:
void LyricsFetcher::postProcess(std::string &data)
{
EscapeHtml(data);
StripHtmlTags(data);
Trim(data);
}