summaryrefslogtreecommitdiff
path: root/stopspam.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2012-03-05 01:42:11 +0200
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2012-03-05 01:42:11 +0200
commitca0c393161bf5ee7578f1a88a7f3ec8e44118f4b (patch)
tree71803f8f1e5971682f084ad7c14559a0a80c534f /stopspam.cpp
parent2cc3972afe16ed661615490de5cad37d870ab375 (diff)
additional checks in math expressions
Diffstat (limited to 'stopspam.cpp')
-rwxr-xr-xstopspam.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/stopspam.cpp b/stopspam.cpp
index f99e4c9..d39e84e 100755
--- a/stopspam.cpp
+++ b/stopspam.cpp
@@ -235,7 +235,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
std::list<int> args;
std::list<TCHAR> actions;
tstring::size_type p1 = gbQuestion.find(_T("X")), p2 = 0;
- const tstring expr_chars = _T("X+-/*");
+ const tstring expr_chars = _T("X+-/*"), expr_acts = _T("+-/*");
while(p1 < gbQuestion.length() && p1 != tstring::npos && expr_chars.find(gbQuestion[p1]) != tstring::npos)
{
std::string arg;
@@ -252,7 +252,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
tmp_question.replace(p2, arg.size(), arg);
#endif
args.push_back(atoi(arg.c_str()));
- if((p1 < gbQuestion.length()) && (p1 != tstring::npos))
+ if((p1 < gbQuestion.length()) && (p1 != tstring::npos) && (expr_acts.find(gbQuestion[p1]) != tstring::npos))
actions.push_back(gbQuestion[p1]);
++p1;
}