]> iEval git - app-devbot.git/commitdiff
untaint --server and --port
authorPhilipp Gortan <philipp.gortan@apa.at>
Mon, 30 Jun 2014 14:45:32 +0000 (16:45 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Mon, 30 Jun 2014 17:04:32 +0000 (20:04 +0300)
Makefile.PL
lib/App/Devbot.pm

index a83aa865f7d9b078129faec77ce35a590ef4f628..446b493232952c509665ac69421faa3f76079cf5 100644 (file)
@@ -19,7 +19,8 @@ WriteMakefile(
                   POE                                     0
                   POE::Component::IRC::Plugin::AutoJoin   0
                   POE::Component::IRC::Plugin::NickServID 0
-                  POE::Component::IRC::State              0/,
+                  POE::Component::IRC::State              0
+                  Regexp::Common                          0/,
        },
        META_MERGE       => {
                dynamic_config => 0,
index 1e0f5c8ff1d54a3db96c67fab02708e05639cb10..d7cd700b47482b3ff191e5b1ec4308356343b9ee 100644 (file)
@@ -15,11 +15,10 @@ use IRC::Utils qw/parse_user/;
 
 use Getopt::Long;
 use POSIX qw/strftime/;
+use Regexp::Common qw /net/;
 
 ##################################################
 
-our $VERSION;
-
 my $nick='devbot';
 my $password;
 my $server='irc.oftc.net';
@@ -73,7 +72,14 @@ sub bot_start{
        Retry_when_banned => 60,
   ));
 
-       $irc->yield(register => "all");
+  if ($server =~ /^($RE{net}{domain})$/) {
+      $server = $1;
+  }
+  if ($port =~ /^([0-9]+)$/) {
+      $port = $1;
+  }
+
+  $irc->yield(register => "all");
   $irc->yield(
        connect => {
          Nick     => $nick,
This page took 0.026037 seconds and 4 git commands to generate.