X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FFCGIFixes.pm;h=62f4a934e25a65ad29637e250cf4b0656c1cdb3a;hb=f05bd96b031d7d4ffaf4804704684ae929a0890a;hp=2bd312c9e8c24f64107870e4b4ca031fec576dd7;hpb=90edf0b1ddcc2aa9ee7cdeb9b46e1ccbea6b0006;p=kivitendo-erp.git diff --git a/SL/FCGIFixes.pm b/SL/FCGIFixes.pm index 2bd312c9e..62f4a934e 100644 --- a/SL/FCGIFixes.pm +++ b/SL/FCGIFixes.pm @@ -4,12 +4,13 @@ use strict; use Encode; use FCGI; +use version; # FCGI does not use Perl's I/O layer. Therefore it does not honor # setting STDOUT to ":utf8" with "binmode". Also FCGI starting with # 0.69 implements proper handling for UTF-8 flagged strings -- namely # by downgrading them into bytes. The combination of the two causes -# Lx-Office's way of handling strings to go belly up (storing +# kivitendo's way of handling strings to go belly up (storing # everything in Perl's internal encoding and using Perl's I/O layer # for automatic conversion on output). # @@ -23,7 +24,7 @@ use FCGI; # that current I/O operations should be raw. sub fix_print_and_internal_encoding_after_0_68 { - return if version->parse($FCGI::VERSION) <= version->parse("0.68"); + return if version->new("$FCGI::VERSION")->numify <= version->new("0.68")->numify; my $encoder = Encode::find_encoding('UTF-8'); my $original_fcgi_print = \&FCGI::Stream::PRINT; @@ -33,7 +34,7 @@ sub fix_print_and_internal_encoding_after_0_68 { *FCGI::Stream::PRINT = sub { if (!$::locale || !$::locale->raw_io_active) { my $self = shift; - my @vals = map { $encoder->encode($_, Encode::FB_CROAK|Encode::LEAVE_SRC) } @_; + my @vals = map { $encoder->encode("$_", Encode::FB_CROAK|Encode::LEAVE_SRC) } @_; @_ = ($self, @vals); }