Skip Menu |

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

Report information
The Basics
Id: 18784
Status: new
Priority: 0/
Queue: XML-SAX-PurePerl

People
Owner: Nobody in particular
Requestors: paul.busse [...] ubizen.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.80
Fixed in: (no value)



Subject: CDATA sections not handled correctly
Matt, I don't know if you still maintain this or not. But anyway... I think the file XML::SAX::Pureperl.pm contains a small typo/bug. 302 sub CDSect { 303 my ($self, $reader) = @_; 304 305 my $data = $reader->data(9); 306 return 0 unless $data =~ /^<!\[CDATA\[/; 307 $reader->move_along(9); 308 309 $self->start_cdata({}); 310 311 $data = $reader->data; 312 while (1) { 313 $self->parser_error("EOF looking for CDATA section end", $reader) 314 unless length($data); 315 316 if ($data =~ /^(.*?)\]\]>/s) { 317 my $chars = $1; 318 $reader->move_along(length($chars) + 2); 319 $self->characters({Data => $chars}); 320 last; 321 } 322 else { 323 $self->characters({Data => $data}); 324 $reader->move_along(length($data)); 325 $data = $reader->data; 326 } 327 } 328 $self->end_cdata({}); 329 return 1; 330 } I'm pretty sure line 318 should '+ 3' instead of '+ 2'. As the end of a CDATA section contains ]]>: 3characters, not 2. BTW, thanks for all the great stuff you did in the Perl domain Kind regards Paul