Skip to content

Commit

Permalink
Console.pm: Decode all arguments before printing them
Browse files Browse the repository at this point in the history
  • Loading branch information
hinrik committed Apr 28, 2011
1 parent f348cf2 commit 2144b2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -15,6 +15,7 @@ Revision history for Perl extension POE::Component::IRC.
didn't register for them.
- Console.pm: Avoid custom stringifications when dumping objects
- State.pm: nick_info() was failing when a nick was known but unsynced
- Console.pm: Decode all arguments before printing them

6.61 Tue Apr 19 17:02:54 GMT 2011
- The changes to the filter test were causing failures on <5.12 due to
Expand Down
4 changes: 3 additions & 1 deletion lib/POE/Component/IRC/Plugin/Console.pm
Expand Up @@ -3,6 +3,7 @@ package POE::Component::IRC::Plugin::Console;
use strict;
use warnings FATAL => 'all';
use Carp;
use IRC::Utils qw(decode_irc);
use POE qw(Wheel::SocketFactory Wheel::ReadWrite Filter::IRCD Filter::Line Filter::Stackable);
use POE::Component::IRC::Plugin qw( :ALL );
use Scalar::Util qw(looks_like_number);
Expand Down Expand Up @@ -62,7 +63,8 @@ sub _dump {
return overload::StrVal($arg);
}
elsif (defined $arg) {
return looks_like_number($arg) ? $arg : "'$arg'";
return $arg if looks_like_number($arg);
return "'".decode_irc($arg)."'";
}
else {
return 'undef';
Expand Down

0 comments on commit 2144b2e

Please sign in to comment.