SF.net SVN: blootbot: [1319] trunk/blootbot
Brought to you by:
timriker
From: <tro...@us...> - 2007-03-13 04:55:22
|
Revision: 1319 http://svn.sourceforge.net/blootbot/?rev=1319&view=rev Author: troubled-irc Date: 2007-03-12 21:55:19 -0700 (Mon, 12 Mar 2007) Log Message: ----------- Fixed bug in "+sed" by enforcing limit on output when using s///g Modified Paths: -------------- trunk/blootbot/ChangeLog trunk/blootbot/src/IRC/IrcHelpers.pl Modified: trunk/blootbot/ChangeLog =================================================================== --- trunk/blootbot/ChangeLog 2007-03-13 04:03:54 UTC (rev 1318) +++ trunk/blootbot/ChangeLog 2007-03-13 04:55:19 UTC (rev 1319) @@ -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 Modified: trunk/blootbot/src/IRC/IrcHelpers.pl =================================================================== --- trunk/blootbot/src/IRC/IrcHelpers.pl 2007-03-13 04:03:54 UTC (rev 1318) +++ trunk/blootbot/src/IRC/IrcHelpers.pl 2007-03-13 04:55:19 UTC (rev 1319) @@ -236,6 +236,8 @@ $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. "\""); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |