Skip Menu |

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

Report information
The Basics
Id: 125052
Status: resolved
Priority: 0/
Queue: XML-FeedPP

People
Owner: Nobody in particular
Requestors: MARKOV [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.43
Fixed in: (no value)



Subject: returns HASH for empty field
In an Atom 10 feed, someone forgot to fill-in the title. Now a HASH gets returned for "$item->title" where it should have been either an empty string or undef. Details: $item->title calls get_value() with $VAR1 = { '-type' => 'text' }; The "#text" key missing. In case of a HASH (this case), _fetch_value() gets called. When this does not find '#text', it leaves the sub with returning the whole HASH. Suggested patch: --- lib/XML/FeedPP.pm +++ libXML/FeedPP.pm.new @@ -2331,6 +2331,7 @@ sub _fetch_value { if ( exists $value->{'#text'} ) { return $self->_fetch_value($value->{'#text'}) } + return undef; } elsif ( UNIVERSAL::isa( $value, 'SCALAR' )) { # CDATA section as a scalar reference return $$value;
taken for 0.95