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:
1 parent
4ed833abbd
commit
e7fc8fa907
1 file changed
+5
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user