Zend Framework

Tag URIs Incorrectly Considered Invalid as Atom Entry IDs

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.10.7
  • Fix Version/s: 1.10.8
  • Component/s: Zend_Feed_Writer
  • Labels:
    None

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:

Activity

Hide
Pádraic Brady added a comment -

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.

Show
Pádraic Brady added a comment - 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.
Hide
Bradley Holt added a comment -

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.

Show
Bradley Holt added a comment - 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.
Hide
Pádraic Brady added a comment -

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.

Show
Pádraic Brady added a comment - 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.
Hide
Bradley Holt added a comment -

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?

Show
Bradley Holt added a comment - 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?
Hide
Pádraic Brady added a comment -

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

Show
Pádraic Brady added a comment - Added in r22758. At least, I like to think so. It is, isn't it? Please? Pretty please?
Hide
Bradley Holt added a comment -

Pádraic,

Yay! You are the best

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

Show
Bradley Holt added a comment - Pádraic, Yay! You are the best I'll mark this as closed once the next mini release is out.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: