]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_redirect.cpp
Fix all typos (not as fun as 'kill all humans' but meh, beggers cant be choosers)
[user/henk/code/inspircd.git] / src / modules / m_redirect.cpp
index a7115a15e35f4931757ba8949c0c796864429375..799eb25deecb3f8ca906eb0ba5fae1ab51f0875c 100644 (file)
@@ -45,11 +45,19 @@ class ModuleRedirect : public Module
                        if (mode_on)
                        {
                                std::string ChanToJoin = params[0];
-                               chanrec* c = Srv->FindChannel(ChanToJoin);
+                               chanrec *c;
+
+                               if (!IsValidChannelName(ChanToJoin.c_str()))
+                               {
+                                       WriteServ(user->fd,"403 %s %s :Invalid channel name",user->nick, ChanToJoin.c_str());
+                                       return 0;
+                               }
+
+                               c = Srv->FindChannel(ChanToJoin);
                                if (c)
                                {
                                        /* Fix by brain: Dont let a channel be linked to *itself* either */
-                                       if ((c == target) || (c->IsCustomModeSet('L')))
+                                       if ((c == target) || (c->IsModeSet('L')))
                                        {
                                                WriteServ(user->fd,"690 %s :Circular redirection, mode +L to %s not allowed.",user->nick,params[0].c_str());
                                                return 0;
@@ -75,7 +83,7 @@ class ModuleRedirect : public Module
        {
                if (chan)
                {
-                       if (chan->IsCustomModeSet('L'))
+                       if (chan->IsModeSet('L'))
                        {
                                if (Srv->CountUsers(chan) >= chan->limit)
                                {