]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Strip a zline target of anything resembling an ident prior to sanity checking rather...
authordz <dz@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 14 Mar 2009 15:12:36 +0000 (15:12 +0000)
committerdz <dz@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 14 Mar 2009 15:12:36 +0000 (15:12 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11220 e03df62e-2008-0410-955e-edbf42e46eb7

src/commands/cmd_zline.cpp

index b0df24a9526af63118541653298c7bbd9b30ea2a..fa54590e2f464ee6cfac751d6600180b3cac8bae 100644 (file)
@@ -41,27 +41,20 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User
                        target = u->GetIPString();
                }
 
-               if (ServerInstance->IPMatchesEveryone(target.c_str(),user))
-                       return CMD_FAILURE;
-
-               long duration = ServerInstance->Duration(parameters[1].c_str());
-
                const char* ipaddr = target.c_str();
-               User* find = ServerInstance->FindNick(target.c_str());
 
-               if (find)
-               {
-                       ipaddr = find->GetIPString();
-               }
-               else
+               if (strchr(ipaddr,'@'))
                {
-                       if (strchr(ipaddr,'@'))
-                       {
-                               while (*ipaddr != '@')
-                                       ipaddr++;
+                       while (*ipaddr != '@')
                                ipaddr++;
-                       }
+                       ipaddr++;
                }
+
+               if (ServerInstance->IPMatchesEveryone(ipaddr,user))
+                       return CMD_FAILURE;
+
+               long duration = ServerInstance->Duration(parameters[1].c_str());
+
                ZLine* zl = new ZLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ipaddr);
                if (ServerInstance->XLines->AddLine(zl,user))
                {