From 5cd0f85e65908777351dd3e6e6ee49fa20319670 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 31 Aug 2017 03:30:22 -0700 Subject: [PATCH] Strip control characters from log messages --- PBot/Logger.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PBot/Logger.pm b/PBot/Logger.pm index 5655ba2e..10d99376 100644 --- a/PBot/Logger.pm +++ b/PBot/Logger.pm @@ -36,6 +36,8 @@ sub log { my ($self, $text) = @_; my $time = localtime; + $text =~ s/(?:[\01-\010]|[\016-\037])/^/g; + if(defined $self->{log_file}) { print PLOG_FILE "$time :: $text"; }