Enclosure URLs usually work fine, even with spaces. But on some occasions RSS readers seem to become confused by spaces in enclosure URLs. For example, in my RSS feed I have an MP3 enclosure named "Rhymes of an Hour - Mix 1.mp3" and the contemplate module leaves this URL unencoded in the RSS enclosure tag's url attribute. Just using urlencode doesn't fix the issue, because it's too thorough - intended for url arguments generally. However, since spaces are the problem, only they need to be encoded. This fixes the issue where RSS readers become confused.

You can test this yourself. Make an RSS feed with a contemplate template, attach an enclosure named like mine, with a few spaces, throw in a dash for good measure. Open this RSS feed in iTunes, and you should get an Error 400 - can't find the file. If, however, you modify contemplate_nodeapi so that it encodes space characters in the name, then clear the cache and/or run cron to get the feed to update, you will find that the enclosure now downloads properly in iTunes.

A patch for the current dev version (and the current 6.x release) is attached to the first edit.

(Drupal core's upload module has the same issue, so I've reported that also.)

CommentFileSizeAuthor
#1 contemplate-[1054198].patch804 bytesthinkyhead
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thinkyhead’s picture

FileSize
804 bytes

Here is the patch.