Skip Menu |

This queue is for tickets about the Net-Rendezvous CPAN distribution.

Report information
The Basics
Id: 25292
Status: resolved
Worked: 1 min
Priority: 0/
Queue: Net-Rendezvous

People
Owner: CHLIGE [...] cpan.org
Requestors: bmathis-bitcard [...] directedge.us
Cc:
AdminCc:

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



Subject: Converting _txtdata to _attr truncates if more than 1 equals sign
When converting _txtdata into _attr name/value pairs, the value is truncated if it contains more than 1 equals (=) sign. This is caused by not putting a limit on the split that does the conversion. An example would be if _txtdata contained: key=value=2 current result is: key = "value" what is expected is: key => "value=2" Here is a patch for Net::Rendezvous::Entry.pm -------------------- --- Entry.pm 2007-03-05 15:02:13.343750000 -0500 +++ Entry.pm.orig 2004-12-28 02:36:19.000000000 -0500 @@ -203,7 +203,7 @@ $self->txtdata([$txtrr->char_str_list ]); $self->index($txti++); foreach my $txtln ( $txtrr->char_str_list ) { - my ($key,$val) = split(/=/,$txtln,2); + my ($key,$val) = split(/=/,$txtln); $self->attribute($key, $val); } $txti++; -------------------- My platform is Activestate Perl 5.8.8 build 820. Net::Rendezvous module version 0.90. Windows XP SP2 with all current patches.
Fix applied and will be available in v0.91. Thanks. - George On Mon Mar 05 15:44:23 2007, bmat wrote: Show quoted text
> When converting _txtdata into _attr name/value pairs, the value is > truncated if it contains more than 1 equals (=) sign. This is caused by > not putting a limit on the split that does the conversion. > > An example would be if _txtdata contained: > key=value=2 > current result is: > key = "value" > what is expected is: > key => "value=2" > > Here is a patch for Net::Rendezvous::Entry.pm > -------------------- > --- Entry.pm 2007-03-05 15:02:13.343750000 -0500 > +++ Entry.pm.orig 2004-12-28 02:36:19.000000000 -0500 > @@ -203,7 +203,7 @@ > $self->txtdata([$txtrr->char_str_list ]); > $self->index($txti++); > foreach my $txtln ( $txtrr->char_str_list ) { > - my ($key,$val) = split(/=/,$txtln,2); > + my ($key,$val) = split(/=/,$txtln); > $self->attribute($key, $val); > } > $txti++; > -------------------- > > My platform is Activestate Perl 5.8.8 build 820. Net::Rendezvous module > version 0.90. Windows XP SP2 with all current patches.