Skip Menu |

This queue is for tickets about the Class-DBI-utf8 CPAN distribution.

Report information
The Basics
Id: 41161
Status: new
Priority: 0/
Queue: Class-DBI-utf8

People
Owner: Nobody in particular
Requestors: FANY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.2
Fixed in: (no value)



Subject: doesn't work in taint mode
Nice module! However, it does not work properly in taint mode, i.e. the utf-8 bit does not get set. The reason for this is that Ima::DBI marks values fetched from the database as tainted, but Encode::_utf8_on() (as used in the trigger sub established by ->utf8_columns) does not work for tainted values. I think this could be fixed with the following patch: 155c155 < use Encode qw( encode_utf8 decode_utf8 ); --- Show quoted text
> use Encode qw( decode_utf8 is_utf8 );
201c201,202 < Encode::_utf8_on($self->{$_}) if defined($self->{$_}); --- Show quoted text
> $self->{$_} = decode_utf8( $self->{$_} ) > if defined $self->{$_} && !is_utf8( $self->{$_} );
If you would rather not change it, I suggest to at least document it and maybe spit out a warning when running with taint mode activated. Regards, fany