]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_gecosban.cpp
Fix dccallow to work with files with spaces in their names
[user/henk/code/inspircd.git] / src / modules / m_gecosban.cpp
index e7eca6d8fd20a7ac4a8f6561ef4fda7e8c7992e0..1497c1b87b3f808503c80da9a03df7d22fb14669 100644 (file)
 class ModuleGecosBan : public Module
 {
  public:
-       ModuleGecosBan()
+       void init()
        {
                Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric };
-               ServerInstance->Modules->Attach(eventlist, this, 2);
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
        ~ModuleGecosBan()
@@ -41,7 +41,7 @@ class ModuleGecosBan : public Module
 
        ModResult OnCheckBan(User *user, Channel *c, const std::string& mask)
        {
-               if (mask[0] == 'r' && mask[1] == ':')
+               if ((mask.length() > 2) && (mask[0] == 'r') && (mask[1] == ':'))
                {
                        if (InspIRCd::Match(user->fullname, mask.substr(2)))
                                return MOD_RES_DENY;