From fb044a78b11216565ac80ebf148a6e5fa4badd3c Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 14 Jan 2007 18:33:02 +0000 Subject: Fix this so that if the beforemode clears the parameter, and it was supposed to have one, we abort git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6327 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/mode.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/mode.cpp b/src/mode.cpp index 695f043da..1ae8dce07 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -455,6 +455,7 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool continue; } + bool had_parameter = !parameter.empty(); for (ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++) { if ((*watchers)->BeforeMode(user, targetuser, targetchannel, parameter, adding, type) == MODEACTION_DENY) @@ -462,6 +463,12 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool abort = true; break; } + /* A module whacked the parameter completely, and there was one. abort. */ + if ((had_parameter) && (parameter.empty())) + { + abort = true; + break; + } } if (abort) -- cgit v1.2.3