diff options
| author | Gavin Andresen <[email protected]> | 2013-11-02 05:27:42 +1000 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2013-11-11 10:22:45 +1000 |
| commit | 17faf562629cd27f00fc138e218ebcc1ce071765 (patch) | |
| tree | 16f48e9238955358df4d5e67bcdc7ad746f9db98 /src/alert.cpp | |
| parent | Improve logging of failed connections (diff) | |
| download | discoin-17faf562629cd27f00fc138e218ebcc1ce071765.tar.xz discoin-17faf562629cd27f00fc138e218ebcc1ce071765.zip | |
Refactor: pull alert string sanitization into util
Diffstat (limited to 'src/alert.cpp')
| -rw-r--r-- | src/alert.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/alert.cpp b/src/alert.cpp index b900fe41e..7f7e59ee1 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -241,15 +241,7 @@ bool CAlert::ProcessAlert(bool fThread) // be safe we first strip anything not in safeChars, then add single quotes around // the whole string before passing it to the shell: std::string singleQuote("'"); - // safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything - // even possibly remotely dangerous like & or > - std::string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@"); - std::string safeStatus; - for (std::string::size_type i = 0; i < strStatusBar.size(); i++) - { - if (safeChars.find(strStatusBar[i]) != std::string::npos) - safeStatus.push_back(strStatusBar[i]); - } + std::string safeStatus = SanitizeString(strStatusBar); safeStatus = singleQuote+safeStatus+singleQuote; boost::replace_all(strCmd, "%s", safeStatus); |