mirror of
https://github.com/znc/znc.git
synced 2026-05-09 23:04:47 +02:00
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:
@@ -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