Skip Menu |

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

Report information
The Basics
Id: 41876
Status: resolved
Worked: 2 min
Priority: 0/
Queue: XML-Tiny

People
Owner: dcantrell [...] cpan.org
Requestors: sky08113 [...] yandex.ru
Cc:
AdminCc:

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



Subject: parsefile(): filename or a string check
Date: Mon, 22 Dec 2008 21:41:48 +0300
To: bug-XML-Tiny [...] rt.cpan.org
From: sky08113 <sky08113 [...] yandex.ru>
Release: XML-Tiny-1.11 Found here: http://search.cpan.org/dist/XML-Tiny/ Has error =BUGGY= if(ref($arg) eq '') { # we were passed a filename or a string if($arg =~ /^_TINY_XML_STRING_(.*)/) { # it's a string #--------------------------------------^ matches any character except newline # # more efficient: rindex($arg, '_TINY_XML_STRING_', 0) or $file = substr($arg, 17) # $file = $1; } else { local *FH; open(FH, $arg) || die(__PACKAGE__."::parsefile: Can't open $arg\n"); $file = <FH>; close(FH); } } else { $file = <$arg>; } #---------------------^ unsuspected value is possible die("No elements\n") if (!defined($file) || $file =~ /^\s*$/); -- Regards Leon
Thanks, fixed in 1.12