added 0x8e to the list of banned characters
[spider.git] / perl / Msg.pm
index b3816df3f324ade51480e1f65d4105cc13d13b6b..a8db113761392d3ffbcf2dfa740288f9a4f97c98 100644 (file)
 
 package Msg;
 
-require Exporter;
-@ISA = qw(Exporter);
-
 use strict;
 use IO::Select;
 use IO::Socket;
-use Carp;
+#use DXDebug;
 
-use vars qw (%rd_callbacks %wt_callbacks $rd_handles $wt_handles);
+use vars qw(%rd_callbacks %wt_callbacks $rd_handles $wt_handles);
 
 %rd_callbacks = ();
 %wt_callbacks = ();
@@ -240,7 +237,8 @@ FINISH:
 
        while (@lines){
                $msg = shift @lines;
-               $msg =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
+               $msg =~ s/\%([2-9A-F][0-9A-F])/chr(hex($1))/eg;
+               $msg =~ s/[\x00-\x08\x0a-\x1f\x9b\x8e]/./g;         # immutable CSI sequence + control characters
                &{$conn->{rcvd_notification_proc}}($conn, $msg, $!);
                $! = 0;
        }