conv: give function EscapeHtml much more appropriate name (StripHtmlTags)
This commit is contained in:
@@ -206,7 +206,7 @@ void EscapeUnallowedChars(std::string &s)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EscapeHtml(std::string &s)
|
void StripHtmlTags(std::string &s)
|
||||||
{
|
{
|
||||||
bool erase = 0;
|
bool erase = 0;
|
||||||
for (size_t i = s.find("<"); i != std::string::npos; i = s.find("<"))
|
for (size_t i = s.find("<"); i != std::string::npos; i = s.find("<"))
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ std::string Shorten(const std::basic_string<my_char_t> &s, size_t max_length);
|
|||||||
|
|
||||||
void EscapeUnallowedChars(std::string &);
|
void EscapeUnallowedChars(std::string &);
|
||||||
|
|
||||||
void EscapeHtml(std::string &s);
|
void StripHtmlTags(std::string &s);
|
||||||
|
|
||||||
void Trim(std::string &s);
|
void Trim(std::string &s);
|
||||||
|
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ void *Info::PrepareArtist(void *screen_void_ptr)
|
|||||||
|
|
||||||
if (a != std::string::npos)
|
if (a != std::string::npos)
|
||||||
{
|
{
|
||||||
EscapeHtml(result);
|
StripHtmlTags(result);
|
||||||
*screen->w << "Last.fm returned an error message: " << result;
|
*screen->w << "Last.fm returned an error message: " << result;
|
||||||
ArtistReady = 1;
|
ArtistReady = 1;
|
||||||
pthread_exit(0);
|
pthread_exit(0);
|
||||||
@@ -259,7 +259,7 @@ void *Info::PrepareArtist(void *screen_void_ptr)
|
|||||||
result[j] = '.';
|
result[j] = '.';
|
||||||
i += static_strlen("<name>");
|
i += static_strlen("<name>");
|
||||||
similar.push_back(result.substr(i, j-i));
|
similar.push_back(result.substr(i, j-i));
|
||||||
EscapeHtml(similar.back());
|
StripHtmlTags(similar.back());
|
||||||
}
|
}
|
||||||
std::vector<std::string> urls;
|
std::vector<std::string> urls;
|
||||||
for (size_t i = result.find("<url>"); i != std::string::npos; i = result.find("<url>"))
|
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);
|
result = result.substr(a, b-a);
|
||||||
}
|
}
|
||||||
|
|
||||||
EscapeHtml(result);
|
StripHtmlTags(result);
|
||||||
Trim(result);
|
Trim(result);
|
||||||
|
|
||||||
std::ostringstream filebuffer;
|
std::ostringstream filebuffer;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ bool LyricsFetcher::getContent(const char *open_tag, const char *close_tag, std:
|
|||||||
|
|
||||||
void LyricsFetcher::postProcess(std::string &data)
|
void LyricsFetcher::postProcess(std::string &data)
|
||||||
{
|
{
|
||||||
EscapeHtml(data);
|
StripHtmlTags(data);
|
||||||
Trim(data);
|
Trim(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user