diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-14 18:33:02 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-14 18:33:02 +0000 |
commit | fb044a78b11216565ac80ebf148a6e5fa4badd3c (patch) | |
tree | e647352ea2c45bb06607421126f38685221ce4f3 | |
parent | c8f3a8d365aeb89455c391efff190ffb48b05a2c (diff) |
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
-rw-r--r-- | src/mode.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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) |