From: dondelelcaro Date: Sat, 17 Dec 2011 17:34:12 +0000 (+0000) Subject: allow all printable characters X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=bf41f919b2a3367ec89a38a35515b7666d9f88b4;p=infobot.git allow all printable characters git-svn-id: https://svn.code.sf.net/p/infobot/code/branches/don/dpkg@1910 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/Factoids/Statement.pl b/src/Factoids/Statement.pl index 48b10cb..c80e3a4 100644 --- a/src/Factoids/Statement.pl +++ b/src/Factoids/Statement.pl @@ -116,16 +116,14 @@ sub doStatement { # verify the update statement whether there are any weird # characters. ### this can be simplified. - foreach ( split //, $lhs . $rhs ) { - my $ord = ord $_; - if ( $ord > 170 and $ord < 220 ) { - &status("statement: illegal character '$_' $ord."); + for my $temp ($lhs,$rhs ) { + if ($temp =~ /([^[:print:]])/) { + &status("statement: illegal character '$1' ".ord($1)."."); &performAddressedReply( "i'm not going to learn illegal characters"); return; } } - # success. return if ( &update( $lhs, $mhs, $rhs ) ); }