3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-23 12:29:27 +01:00

Replace control chars with escaped ordinals

This commit is contained in:
Pragmatic Software 2017-09-02 00:19:39 -07:00
parent 2f014ba2f0
commit 5ee07e08d2
2 changed files with 2 additions and 1 deletions

View File

@ -82,6 +82,7 @@ sub process_line {
$text =~ s/^\s+//;
$text =~ s/\s+$//;
$text =~ s/([\01-\010]|[\016-\037])/'\\' . ord $1/ge;
my $cmd_text = $text;
$cmd_text =~ s/^\/me\s+//;

View File

@ -36,7 +36,7 @@ sub log {
my ($self, $text) = @_;
my $time = localtime;
$text =~ s/(?:[\01-\010]|[\016-\037])/^/g;
$text =~ s/([\01-\010]|[\016-\037])/'\\' . ord $1/ge;
if(defined $self->{log_file}) {
print PLOG_FILE "$time :: $text";