Use bytes::length instead of bytes to avoid utf8 problems

This commit is contained in:
Xavier Guimard 2010-08-19 15:11:32 +00:00
parent f0af83546a
commit ad8635f868
2 changed files with 4 additions and 2 deletions

View File

@ -9,6 +9,7 @@
package Lemonldap::NG::Common::CGI::SOAPServer;
use SOAP::Transport::HTTP;
use base qw(SOAP::Transport::HTTP::Server);
use bytes;
our $VERSION = '0.32';
@ -39,7 +40,7 @@ sub handle {
my $cgi = shift;
my $content = $cgi->param('POSTDATA');
my $length = length($content);
my $length = bytes::length($content);
if ( !$length ) {
$self->response( HTTP::Response->new(411) ) # LENGTH REQUIRED

View File

@ -9,6 +9,7 @@ package Lemonldap::NG::Common::Crypto;
use strict;
use Crypt::Rijndael;
use MIME::Base64;
use bytes;
use base qw(Crypt::Rijndael);
our $VERSION = '0.2';
@ -34,7 +35,7 @@ sub encrypt {
my $tmp;
eval {
$tmp = encode_base64(
$self->SUPER::encrypt( $str . "\0" x ( 16 - length($str) % 16 ) ),
$self->SUPER::encrypt( $str . "\0" x ( 16 - bytes::length($str) % 16 ) ),
'' );
};
if ($@) {