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:
parent
2f014ba2f0
commit
5ee07e08d2
@ -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+//;
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user