]> git.donarmstrong.com Git - infobot.git/commitdiff
allow all printable characters
authordondelelcaro <dondelelcaro@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 17 Dec 2011 17:34:12 +0000 (17:34 +0000)
committerdondelelcaro <dondelelcaro@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 17 Dec 2011 17:34:12 +0000 (17:34 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/branches/don/dpkg@1910 c11ca15a-4712-0410-83d8-924469b57eb5

src/Factoids/Statement.pl

index 48b10cb70944afcd70ce7c6bc0b2e95c8afec48a..c80e3a4add88e8b46dc7c9d2c6bae92a329e5b34 100644 (file)
@@ -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 ) );
     }