Decode XML string from DBI notification backend (#327)

environments/ppa-mbqj77/deployments/1
Clément Oudot 14 years ago
parent 8fd963ee31
commit 56d12ce86b
  1. 14
      modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Notification/DBI.pm

@ -8,8 +8,9 @@ package Lemonldap::NG::Portal::Notification::DBI;
use strict;
use Time::Local;
use DBI;
use utf8;
our $VERSION = '1.0.0';
our $VERSION = '1.1.0';
## @method boolean prereq()
# Check if DBI parameters are set.
@ -45,7 +46,16 @@ sub get {
or return ();
my $result;
while ( my $h = $self->{sth}->fetchrow_hashref() ) {
$result->{"$h->{date}#$h->{uid}#$h->{ref}"} = $h->{xml};
# Get XML message
my $xml = $h->{xml};
# Decode it twice to get the correct uncoded string
utf8::decode($xml);
utf8::decode($xml);
# Store message in result
$result->{"$h->{date}#$h->{uid}#$h->{ref}"} = $xml;
}
$self->lmLog( $self->{sth}->err(), 'warn' ) if ( $self->{sth}->err() );
return $result;

Loading…
Cancel
Save