]> git.donarmstrong.com Git - infobot.git/blobdiff - src/IRC/IrcHelpers.pl
Fixed bug in "+sed" by enforcing limit on output when using s///g
[infobot.git] / src / IRC / IrcHelpers.pl
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. "\"");