Use bytes::length instead of bytes to avoid utf8 problems
This commit is contained in:
parent
f0af83546a
commit
ad8635f868
|
@ -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
|
||||
|
|
|
@ -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 ($@) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user