| 22 | using namespace std; |
| 23 | |
| 24 | string 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 | |
| 39 | const signed char p_util_hexdigit[256] = |
| 40 | { |
no test coverage detected