Subject: | Bug in Net::XMPP::Stanza with fix |
Date: | Tue, 29 Jun 2010 18:25:24 +0100 |
To: | bug-Net-XMPP [...] rt.cpan.org |
From: | Tom Lawton <tlawton [...] gmx.de> |
Hi,
Spent ages trying to work out why my jabber bot couldn't spot delay
tags, until I found the bug in Stanza.pm _parse_tree. I've enclosed
the fixed version of the function below (only the one line indicated
has changed).
thanks,
tom
sub _parse_tree
{
my $self = shift;
my @xTrees = $self->{TREE}->XPath('*[@xmlns]');
if ($#xTrees > -1)
{
foreach my $xTree (@xTrees)
{
if( exists($Net::XMPP::Namespaces::NS{$xTree-
Show quoted text
>get_attrib("xmlns")}))
### TL *** Changed above line to say xTree rather
than xTrees[0]
{
$self->AddChild($xTree);
$self->{TREE}->remove_child($xTree);
}
}
}
}