Subject: | Bug XML/SAX/PurePerl.pm, sub CDSect |
Date: | Mon, 09 Feb 2009 19:39:26 +0100 |
To: | bug-XML-SAX [...] rt.cpan.org |
From: | Herbert Schiemann <h.schiemann [...] laemmerzahl.de> |
Hello,
trying to connect to https://rt.cpan.org/ I get the error code
sec_error_unknown_issuer, so I write this mail.
I'm using XML-SAX-0.96.
sub CDSect in file XML/SAX/PurePerl.pm should be like
sub CDSect {
my ($self, $reader) = @_;
my $data = $reader->data(9);
return 0 unless $data =~ /^<!\[CDATA\[/;
$reader->move_along(9);
$self->start_cdata({});
my $chars;
while (1) {
# do not miss "]]>", so try to read at leas 3 chars
$data = $reader->data(3);
$self->parser_error
("EOF looking for CDATA section end", $reader)
unless length($data);
if ($data =~ /^(.*?)\]\]>/s) {
$chars = $1;
$reader->move_along(length($chars) + 3);
$self->characters({Data => $chars});
last;
}
else {
# the last one or two "]" could be the beginning of a "]]>",
# so do no eat them
$data =~ /^(.*?)\]{0,2}+$/s;
$chars = $1;
$reader->move_along(length($chars));
$self->characters({Data => $chars});
}
}
$self->end_cdata({});
return 1;
}
The comments show the problem. It shows up if the boundary of a chunk
occurs after the first or the second "]" of the terminating "]]>".
Regards, Herbert