projects
/
catagits/Web-Simple.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
aacb774
)
avoid undef errors blowing out XML::Tags
Matt S Trout [Thu, 10 Feb 2011 18:17:01 +0000 (18:17 +0000)]
lib/XML/Tags.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/XML/Tags.pm
b/lib/XML/Tags.pm
index
9249691
..
8b30b60
100644
(file)
--- a/
lib/XML/Tags.pm
+++ b/
lib/XML/Tags.pm
@@
-26,7
+26,11
@@
sub to_xml_string {
ref($_)
? (ref $_ eq 'SCALAR' ? $$_ : $_)
: do { local $_ = $_; # copy
- s/&/&/g; s/"/"/g; s/</</g; s/>/>/g; $_;
+ if (defined) {
+ s/&/&/g; s/"/"/g; s/</</g; s/>/>/g; $_;
+ } else {
+ ''
+ }
}
} @_
}