MCPcopy Create free account
hub / github.com/LUX-Core/lux / SanitizeString

Function SanitizeString

src/utilstrencodings.cpp:24–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22using namespace std;
23
24string SanitizeString(const string& str)
25{
26 /**
27 * safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything
28 * even possibly remotely dangerous like & or >
29 */
30 static string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@()");
31 string strResult;
32 for (std::string::size_type i = 0; i < str.size(); i++) {
33 if (safeChars.find(str[i]) != std::string::npos)
34 strResult.push_back(str[i]);
35 }
36 return strResult;
37}
38
39const signed char p_util_hexdigit[256] =
40 {

Callers 7

add_onion_cbMethod · 0.85
authchallenge_cbMethod · 0.85
parseMethod · 0.85
NotifyMethod · 0.85
ProcessMessageFunction · 0.85
ProcessMessagesFunction · 0.85
EXCLUSIVE_LOCK_FUNCTIONFunction · 0.85

Calls 3

sizeMethod · 0.45
findMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected