Fix escaping of '"' in XML::Tags::to_xml_string
Jakub Narebski [Wed, 16 Dec 2009 10:57:27 +0000 (11:57 +0100)]
Double quote ('"') should be escaped as '"', not as '&quot'.
This fixes a bug found in 'Escaping ok' test in t/tags.t

Signed-off-by: Jakub Narebski <jnareb@gmail.com>

lib/XML/Tags.pm

index 0c9ff8b..9249691 100644 (file)
@@ -26,7 +26,7 @@ sub to_xml_string {
     ref($_)
       ? (ref $_ eq 'SCALAR' ? $$_ : $_)
       : do { local $_ = $_; # copy
-          s/&/&amp;/g; s/"/&quot/g; s/</&lt;/g; s/>/&gt;/g; $_;
+          s/&/&amp;/g; s/"/&quot;/g; s/</&lt;/g; s/>/&gt;/g; $_;
         }
   } @_
 }