Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 47279
Status: resolved
Priority: 0/
Queue: XML-Atom-SimpleFeed

People
Owner: ARISTOTLE [...] cpan.org
Requestors: daxim [...] cpan.org
Cc:
AdminCc:

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

Attachments
0001-tests-for-element-content-encoding.patch



Subject: author field not properly encoded
Download (untitled) / with headers
text/plain 166b
Run the synopsis and name the feed author "John Doe & \x{263a}". Because this is passed through unchanged, the resulting feed is invalid XML. Tests for this attached.
Subject: 0001-tests-for-element-content-encoding.patch
From 70c72b513f270c2f317b991e0658720cc5224b9d Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Lars=20D=C9=AA=E1=B4=87=E1=B4=84=E1=B4=8B=E1=B4=8F=E1=B4=A1=20=E8=BF=AA=E6=8B=89=E6=96=AF?= <daxim@cpan.org> Date: Tue, 23 Jun 2009 17:52:57 +0200 Subject: [PATCH] tests for element content encoding --- t/01.xml_writer.t | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/t/01.xml_writer.t b/t/01.xml_writer.t index 181472f..705eee1 100644 --- a/t/01.xml_writer.t +++ b/t/01.xml_writer.t @@ -4,7 +4,7 @@ use strict; use XML::Atom::SimpleFeed; package XML::Atom::SimpleFeed; -use Test::More tests => 7; +use Test::More tests => 9; is xml_escape( $_ = qq(<\x{FF34}\x{FF25}\x{FF33}\x{FF34} "&' d\xE3t\xE3>) ), qq(&lt;&#65332;&#65317;&#65331;&#65332; &#34;&#38;&#39; d&#227;t&#227;&gt;), @@ -20,5 +20,7 @@ is xml_string( $_ = qq(Test <![CDATA[<CDATA>]]> sections) ), is xml_tag( 'br' ), '<br/>', 'simple tags are self-closed'; is xml_tag( 'b', 'foo', '<br/>' ), '<b>foo<br/></b>', 'tags with content are properly formed'; +is xml_tag( 'b', 'foo &' ), '<b>foo &#38;</b>', 'XML special characters in element content are encoded'; +is xml_tag( 'b', 'foo ☺' ), '<b>foo &#9786;</b>', 'non-ASCII in element content is encoded'; is xml_tag( [ 'br', clear => 'left' ] ), '<br clear="left"/>', 'simple tags can have attributes'; is xml_tag( [ 'b', style => 'color: red' ], 'foo', '<br/>' ), '<b style="color: red">foo<br/></b>', 'simple tags can have attributes'; -- 1.6.3
Download (untitled) / with headers
text/plain 716b
On Tue Jun 23 12:05:44 2009, DAXIM wrote: Show quoted text
> Run the synopsis and name the feed author "John Doe & \x{263a}". > Because this is passed through unchanged, the resulting feed is > invalid XML.
Thanks for the report. Show quoted text
> Tests for this attached.
Thanks for the effort; unfortunately the tests were incorrect. The C<xml_tag> function is not supposed to encode the content that is passed to it. It's C<person_construct>'s job, in this case. I have added minimal tests to trigger this bug and written a fix for it. I've rolled a 0.86 release which is now winding its way to CPAN. I'll assume that the bug is fixed, so I'm marking this ticket resolved. If this release does *not* fix your problem, then please let me know.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.