From 2ef640de194edb591d02ce6827f24d3f718de7d1 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 27 Feb 2020 14:20:42 -0800 Subject: [PATCH] Plugins/TypoSub: limit length of s//g replacements --- Plugins/TypoSub.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Plugins/TypoSub.pm b/Plugins/TypoSub.pm index 11e51a5f..0373a719 100644 --- a/Plugins/TypoSub.pm +++ b/Plugins/TypoSub.pm @@ -51,6 +51,7 @@ sub on_public { if ($msg =~ m/^\s*s${sep}(.*?)(? 1; my $rx = qr/$regex/; my $messages = $self->{pbot}->{messagehistory}->{database}->get_recent_messages_from_channel($channel, 50, $self->{pbot}->{messagehistory}->{MSG_CHAT}, 'DESC'); @@ -82,6 +83,7 @@ sub on_public { defined $_ || last, ++$i, $t =~ s|[\$\\]$i|$_|g for @stuff; $t }gxe; + $text = substr($text, 0, 350); } else { $text =~ s{$rx} {