put local functions into unnamed namespaces
This commit is contained in:
@@ -32,30 +32,33 @@ pthread_mutex_t curl = PTHREAD_MUTEX_INITIALIZER;
|
||||
bool data_ready = 0;
|
||||
#endif
|
||||
|
||||
size_t write_data(char *buffer, size_t size, size_t nmemb, string data)
|
||||
namespace
|
||||
{
|
||||
int result = 0;
|
||||
if (buffer)
|
||||
size_t write_data(char *buffer, size_t size, size_t nmemb, string data)
|
||||
{
|
||||
data += buffer;
|
||||
result = size*nmemb;
|
||||
int result = 0;
|
||||
if (buffer)
|
||||
{
|
||||
data += buffer;
|
||||
result = size*nmemb;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void EscapeHtml(string &str)
|
||||
{
|
||||
for (int i = str.find("<"); i != string::npos; i = str.find("<"))
|
||||
void EscapeHtml(string &str)
|
||||
{
|
||||
int j = str.find(">")+1;
|
||||
str.replace(i, j-i, "");
|
||||
for (int i = str.find("<"); i != string::npos; i = str.find("<"))
|
||||
{
|
||||
int j = str.find(">")+1;
|
||||
str.replace(i, j-i, "");
|
||||
}
|
||||
for (int i = str.find("'"); i != string::npos; i = str.find("'"))
|
||||
str.replace(i, 6, "'");
|
||||
for (int i = str.find("""); i != string::npos; i = str.find("""))
|
||||
str.replace(i, 6, "\"");
|
||||
for (int i = str.find("&"); i != string::npos; i = str.find("&"))
|
||||
str.replace(i, 5, "&");
|
||||
}
|
||||
for (int i = str.find("'"); i != string::npos; i = str.find("'"))
|
||||
str.replace(i, 6, "'");
|
||||
for (int i = str.find("""); i != string::npos; i = str.find("""))
|
||||
str.replace(i, 6, "\"");
|
||||
for (int i = str.find("&"); i != string::npos; i = str.find("&"))
|
||||
str.replace(i, 5, "&");
|
||||
}
|
||||
|
||||
#ifdef HAVE_CURL_CURL_H
|
||||
|
||||
Reference in New Issue
Block a user