Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linefeed filtering issue where: (a) Atom feed and (b) title element type != HTML or XHTML #204

Closed
Echelon9 opened this issue Jul 28, 2013 · 0 comments
Assignees

Comments

@Echelon9
Copy link
Contributor

As reported on the forums: http://forums.cocoaforge.com/viewtopic.php?f=18&t=26298&sid=8f90ce829f0abb3d7314e3d71e2c8a3f

A corner case remains where linefeed type characters can make their way into a title element of an Atom feed.

Following circumstances must exist:

  • Atom feed
  • Title element has a type that is not "HTML" or "XHTML"
  • Linefeed characters exist in the text of the title

Kwik was able to helpfully provide an example Atom feed which reproduces the issue. The feed is of comments to a Google Blogspot dummy feed: http://rssfeedtesting.blogspot.com/feeds/comments/default (available at time of this posting)

The issue is that in src/RichXMLParser.m the Atom branch of the parsing code applies summaryTextFromHTML only to titles explicitly marked with HTML or XHTML types.

Given this is data from the network, we should enforce regardless.

Resolving this issue will have the side effect of bringing the RSS and Atom parsing into line with each other for the title element.

// Parse item title
if ([itemNodeName isEqualToString:@"title"])
{
        NSString * newTitle = [[subItemTree valueOfElement] stringByUnescapingExtendedCharacters];
        NSString * titleType = [subItemTree valueOfAttribute:@"type"];

        if ([titleType isEqualToString:@"html"] || [titleType isEqualToString:@"xhtml"])
                newTitle = [newTitle summaryTextFromHTML];

        [newItem setTitle:newTitle];
        continue;
}
@ghost ghost assigned Echelon9 Jul 28, 2013
barijaona added a commit that referenced this issue Jul 28, 2013
Resolve Issue #204: Linefeed filtering issue where: (a) Atom feed and (b) title element type != HTML or XHTML
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant