CUser::AddCTCPReply(): Reject CTCP requests containing spaces

CTCP requests can't contain spaces so it's useless to specify rules for those.

This doesn't affect any of the existing callers because those use Token(0) for
generating the first argument to this function.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2011-02-18 13:06:28 +01:00
parent 4ed833abbd
commit e7fc8fa907
+5 -1
View File
@@ -1253,10 +1253,14 @@ void CUser::SetIRCNick(const CNick& n) {
}
bool CUser::AddCTCPReply(const CString& sCTCP, const CString& sReply) {
// Reject CTCP requests containing spaces
if (sCTCP.find_first_of(' ') != CString::npos) {
return false;
}
// Reject empty CTCP requests
if (sCTCP.empty()) {
return false;
}
m_mssCTCPReplies[sCTCP.AsUpper()] = sReply;
return true;
}