This queue is for tickets about the XML-RPC CPAN distribution.

Report information
The Basics
Id:
75078
Status:
new
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
fgwaller [...] flyingpenguin.de
Cc:
AdminCc:

BugTracker
Severity:
Important
Broken in:
  • 0.1
  • 0.2
  • 0.3
  • 0.4
  • 0.5
  • 0.6
  • 0.7
  • 0.8
  • 0.9
Fixed in:
(no value)



Subject: autodetection of XML datatyp <i4> for string of digits starting with 0
So far data type i4 is matched as m/^[\-+]?\d+$/ unfortunately this will match not only strings that can be uniquely and reversibly stored as 32bit integer numbers but also any string of digits that will represent/contain a 32 bit number like "01", "0800555123", "00" or "0000" to just list a few. to fix this I replaced the match with the following: m/^[\-+]?(0|[1-9]\d*)$/ which should fix this problem. For the sake of simplicity: here the complete patched function. sub parse_scalar { my $self = shift; my $scalar = shift; local $^W = undef; if ( ( $scalar =~ m/^[\-+]?(0|[1-9]\d*)$/ ) && ( abs($scalar) <= ( 0xffffffff >> 1 ) ) ) { return { i4 => $scalar }; } elsif ( $scalar =~ m/^[\-+]?\d+\.\d+$/ ) { return { double => $scalar }; } else { return { string => \$scalar }; } } Please update in your next release, I do not claim any rights on this code, please distribute freely!


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.