]> git.donarmstrong.com Git - infobot.git/commitdiff
Fixed bug in "+sed" by enforcing limit on output when using s///g
authortroubled-irc <troubled-irc@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 13 Mar 2007 04:55:19 +0000 (04:55 +0000)
committertroubled-irc <troubled-irc@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 13 Mar 2007 04:55:19 +0000 (04:55 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1319 c11ca15a-4712-0410-83d8-924469b57eb5

ChangeLog
src/IRC/IrcHelpers.pl

index d3ffba8a16c255109f7d6e552373c3a363bb3f94..3257231e99b91ec77d4e64cd2532294b23b4fe8c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-03-13     troubled
+
+       * src/IRC/IrcHelpers.pl: Fixed bug in "+sed" that caused the bot
+         to flood itself off the network when passed large s///g;. A
+         temporary limit of 255 charaters on the output has been enabled.
+
 2007-03-11 22:00  troubled
 
        * src/{Process.pl,UserExtra.pl}: Fixed bug with karma stats. It
index 7e273d657c37608668a9239c9e15122ae1cad687..cc53742069fc4fe2ec826c6f7a0c30f46a971a1a 100644 (file)
@@ -236,6 +236,8 @@ sub hookMsg {
             $orig{message} =~ /^s\/([^;\/]*)\/([^;\/]*)\/([g]*)$/) {
        my $sedmsg = $seencache{$who}{'msg'};
        eval "\$sedmsg =~ s/\Q$1\E/\Q$2\E/$3;";
+       $sedmsg =~ s/^(.{255}).*$/$1.../; # 255 char max to prevent flood
+
        if ($sedmsg ne $seencache{$who}{'msg'}) {
            &DEBUG("sed \"" . $orig{message} . "\" \"" .
                    $seencache{$who}{'msg'} . "\" \"" . $sedmsg. "\"");