for example, on page:

http://drupal.org/taxonomy/term/1+2

you get an RSS url with a space in it

http://drupal.org/taxonomy/term/1 2/0/feed

if you have a smart browser, it inserts %20 between 1 and 2, but maybe some browsers and RSS bots are not so smart.

CommentFileSizeAuthor
#1 04_taxorss.patch1.58 KBmorbus iff

Comments

morbus iff’s picture

Assigned: Unassigned » morbus iff
StatusFileSize
new1.58 KB

Theoretically, a browser should ALWAYS see the space as %20 when it comes to a URL - that's just part of the HTTP spec (URL encoding, blah blah blah). The underlying code of taxonomy_term_page also supports a space as an "or" delimiter, and comments on it as well ("The '+' character in a query string may be parsed as ' '."). With that said, the plus-to-space conversion is happening BEFORE taxonomy_term_page (where the RSS URLs are written). This appears to be a normal part of the menu callback code (in this particular case, the menu code appears to be passing the remaining parts of the URL, unencoded [as it should], to the taxonomy_term_page function.

If we really wanted the RSS URLs to be written with the space, we'd need to do a re-conversion inside taxonomy_term_page. I've included a patch to do so, using an innocent urlencode on the space-separated $str_tids, turning it into a plus-separated $rss_tids.

Steven’s picture

The conversion from + to space is in fact done by PHP, not by the menu system. The clean URL gets rewritten to ?q=1+2, which is interpreted as '1 2'. If you need a + in a GET query, you need to use a %XX escape.

Applied to HEAD, but I did modify the comment on the urlencode line.

  // put the + signs back in to create RSS URLs that match
  // the normal taxonomy URL (+ signs become spaces during
  // URL unencoding by the menu callback, so we encode the
  // spaces back into a + for RSS URL output. node/13550.

To:

  // Needed for '+' to show up in RSS discovery URLs

Referring to issues is a bit unnecessary: when I modify the code later, I want to know how it is now, not how it was before.

Anonymous’s picture