Skip Menu |

This queue is for tickets about the WordPress-XMLRPC CPAN distribution.

Report information
The Basics
Id: 97830
Status: new
Priority: 0/
Queue: WordPress-XMLRPC

People
Owner: Nobody in particular
Requestors: info [...] gwendragon.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.23
Fixed in: (no value)



Subject: On Windows missing binmode in get_file_bits() destroy binary data
Missing binmode(FILE) in get_file_bits() results in defect binary data on Windows. See https://metacpan.org/source/LEOCHARRE/WordPress-XMLRPC-1.23/lib/WordPress/XMLRPC.pm#L150
From: info [...] gwendragon.de
Am Do 07. Aug 2014, 07:31:32, info@gwendragon.de schrieb: Show quoted text
> Missing binmode(FILE) in get_file_bits() results in defect binary data > on Windows. > > See https://metacpan.org/source/LEOCHARRE/WordPress-XMLRPC- > 1.23/lib/WordPress/XMLRPC.pm#L150
Attached fixed version and patch.
Subject: XMLRPC_fixed.pm

Message body is not shown because it is too large.

From: info [...] gwendragon.de
Patch in XMLRPC.patch
Subject: XMLRPC.patch
diff --git "a/XMLRPC.pm" "b/XMLRPC_fixed.pm" index ae0fa44..d6e6d79 100644 --- "a/XMLRPC.pm" +++ "b/XMLRPC_fixed.pm" @@ -4,7 +4,7 @@ use strict; use Carp; use LEOCHARRE::Debug; use vars qw($VERSION $DEBUG); -$VERSION = sprintf "%d.%02d", q$Revision: 1.23 $ =~ /(\d+)/g; +$VERSION = sprintf "%d.%02d", q$Revision: 1.23.1 $ =~ /(\d+)/g; sub new { my ($class,$self) = @_; @@ -148,6 +148,8 @@ sub abs_path_to_media_object_data { require MIME::Base64; open(FILE, $abs_path) or die($!); + binmode FILE; ### fix for Win32 if binary data (GwenDragon) + ### see bug https://rt.cpan.org/Public/Bug/Display.html?id=97830 my $bits; my $buffer; while( read(FILE, $buffer, (60*57)) ) {