]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Factoids/Update.pl
- I broke maths when I tried to fix "999!" - fixed :-)
[infobot.git] / src / Factoids / Update.pl
index ff69ad9989255ca4ff07a392916da3d7e197ce6f..5fa7c4edceef36f11ce89d12cd618bcb5309fddf 100644 (file)
@@ -62,15 +62,28 @@ sub update {
        }
     }
 
+    # factoid arguments handler.
     if (&IsChanConf("factoidArguments") and $lhs =~ /\$/) {
        &status("Update: Factoid Arguments found.");
        &status("Update: orig lhs => '$lhs'.");
        &status("Update: orig rhs => '$rhs'.");
-       $lhs =~ s/^/CMD: /;
+
        my @list;
+       my $count = 0;
+       $lhs =~ s/^/CMD: /;
        while ($lhs =~ s/\$(\S+)/(.*?)/) {
            push(@list, "\$$1");
+           $count++;
+           last if ($count >= 10);
        }
+
+       if ($count >= 10) {
+           &msg($who, "error: could not SAR properly.");
+           &DEBUG("error: lhs => '$lhs'.");
+           &DEBUG("error: rhs => '$rhs'.");
+           return;
+       }
+
        my $z = join(',',@list);
        $rhs =~ s/^/($z): /;