Issues

ZF-10246: Tag URIs Incorrectly Considered Invalid as Atom Entry IDs

Description

When using Zend_Feed_Writer to create an Atom feed and attempting to use a tag URI such as:

tag:example.org,2010:/foo/bar/

The following exception is raised:

"Atom 1.0 IDs must be a valid URI/IRI"

Please allow tag URIs to be used as Atom Entry IDs within Zend_Feed_Writer as these are valid URIs. There are probably other valid URIs that are incorrectly marked as invalid as well since Zend_Feed_Writer appears to only consider Uniform Resource Name (URN) URIs to be valid, but URN is only a subset of URI.

For reference: * http://diveintomark.org/archives/2004/… * http://www.ietf.org/rfc/rfc2396.txt

Comments

Hey Bradley,

Unfortunately Zend_Uri (used for validation in Zend_Feed and almost everywhere else in ZF for URIs) is essentially Zend_Url - so all URIs outside of URLs and URNs (already a custom addition) require custom validation code. It's something I'm monitoring for ZF2 whenever someone starts digging into Zend\Uri. I'll see what support can be added on an ad-hoc basis over the weekend, though it will be limited to tag: and a few others of more common interest.

Pádraic,

All I really need (at least right now) is support for tag URIs (I'm creating a feed based on existing entries in another feed, so I don't have a choice as to what kind of IDs to use). Simply allowing tag URIs will work for me and solve my problem. Maybe provide an option to skip ID validation until full URI validation is available? Just a thought, but that might be a bad idea.

Fixed in r22753. Bradley, let me know if this works for you. Note that email checking (if part of the URI) does not perform MX checks. Fix will be ported to ZF 2.0 shortly.

Pádraic,

The issue I was having was with Atom Entries, not Atom Feeds (my feeds have URLs as IDs). Can you add that same validation for tag URIs in Zend_Feed_Writer_Renderer_Entry_Atom?

Added in r22758. At least, I like to think so. It is, isn't it? Please? Pretty please? ;)

Pádraic,

Yay! You are the best :-)

I'll mark this as closed once the next mini release is out.