Make WordPress Core

Opened 21 years ago

Closed 21 years ago

#1538 closed defect (bug) (fixed)

Trailing slash on RSS feed URL generates a spurious blank line in XML output

Reported by: Frobenius Owned by:
Priority: normal Milestone:
Component: XML-RPC Version: 1.5.1.2
Severity: normal Keywords: permalinks RSS XML blank line
Cc: Focuses:

Description

When generating RSS feeds and using permalinks, the url to the RSS feed includes a trailing slash. When the url contains a trailing slash, row 1 of the RSS XML generated by WordPress contains a blank line. This causes the RSS feed to fail validation. Here is an example:

​http://www.valenceband.com/wp/feed/ ...generates a blank line on row 1.
​http://www.valenceband.com/wp/feed ...does not generate a blank line.

The url without permalinks works perfectly, of course:

​http://www.valenceband.com/wp/?feed=rss2

I have only tested this with 1.5.1.3.

Why does the trailing slash generate a blank line in the RSS feed XML? It works the same with any theme and with plug-ins deactivated. Perhaps the get_feed_link function in template-functions-links.php could be modified to generate a url without the trailing slash when using permalinks.

Change History (3)

#1 @markjaquith
21 years ago

Cannot duplicate. Could you paste your relevant mod_rewrite lines please? (from .htaccess ... include all the wp/feed related ones)

#2 @Frobenius
21 years ago

Every module has been upgraded to WordPress 1.5.2 and now it no longer matters if there is a trailing slash or not, a blank line is generated (with default theme and all plugins disabled), so the problem has grown worse, not better. I haven't any idea which .htaccess lines are relevant. Here is the .htaccess file generated by WordPress:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .*$ - [S=45]
RewriteRule
(sulfur_island)/trackback/?$ /wp/index.php?pagename=$1&tb=1 [QSA,L]
RewriteRule (sulfur_island)/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?pagename=$1&feed=$2 [QSA,L]
RewriteRule
(sulfur_island)/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?pagename=$1&feed=$2 [QSA,L]
RewriteRule (sulfur_island)/page/?([0-9]{1,})/?$ /wp/index.php?pagename=$1&paged=$2 [QSA,L]
RewriteRule
(sulfur_island)(/[0-9]+)?/?$ /wp/index.php?pagename=$1&page=$2 [QSA,L]
RewriteRule (mof)/trackback/?$ /wp/index.php?pagename=$1&tb=1 [QSA,L]
RewriteRule
(mof)/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?pagename=$1&feed=$2 [QSA,L]
RewriteRule (mof)/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?pagename=$1&feed=$2 [QSA,L]
RewriteRule
(mof)/page/?([0-9]{1,})/?$ /wp/index.php?pagename=$1&paged=$2 [QSA,L]
RewriteRule (mof)(/[0-9]+)?/?$ /wp/index.php?pagename=$1&page=$2 [QSA,L]
RewriteRule
feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?&feed=$1 [QSA,L]
RewriteRule (feed|rdf|rss|rss2|atom)/?$ /wp/index.php?&feed=$1 [QSA,L]
RewriteRule
page/?([0-9]{1,})/?$ /wp/index.php?&paged=$1 [QSA,L]
RewriteRule comments/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?&feed=$1&withcomments=1 [QSA,L]
RewriteRule
comments/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?&feed=$1&withcomments=1 [QSA,L]
RewriteRule comments/page/?([0-9]{1,})/?$ /wp/index.php?&paged=$1 [QSA,L]
RewriteRule
search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?s=$1&feed=$2 [QSA,L]
RewriteRule search/(.+)/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?s=$1&feed=$2 [QSA,L]
RewriteRule
search/(.+)/page/?([0-9]{1,})/?$ /wp/index.php?s=$1&paged=$2 [QSA,L]
RewriteRule search/(.+)/?$ /wp/index.php?s=$1 [QSA,L]
RewriteRule
rsp/category/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?category_name=$1&feed=$2 [QSA,L]
RewriteRule rsp/category/(.+)/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?category_name=$1&feed=$2 [QSA,L]
RewriteRule
rsp/category/(.+)/page/?([0-9]{1,})/?$ /wp/index.php?category_name=$1&paged=$2 [QSA,L]
RewriteRule rsp/category/(.+)/?$ /wp/index.php?category_name=$1 [QSA,L]
RewriteRule
rsp/author/([/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?author_name=$1&feed=$2 [QSA,L]
RewriteRule
rsp/author/([/]+)/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?author_name=$1&feed=$2 [QSA,L]
RewriteRule
rsp/author/([/]+)/page/?([0-9]{1,})/?$ /wp/index.php?author_name=$1&paged=$2 [QSA,L]
RewriteRule
rsp/author/([/]+)/?$ /wp/index.php?author_name=$1 [QSA,L]
RewriteRule
rsp/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?year=$1&monthnum=$2&day=$3&feed=$4 [QSA,L]
RewriteRule rsp/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?year=$1&monthnum=$2&day=$3&feed=$4 [QSA,L]
RewriteRule
rsp/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$ /wp/index.php?year=$1&monthnum=$2&day=$3&paged=$4 [QSA,L]
RewriteRule rsp/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /wp/index.php?year=$1&monthnum=$2&day=$3 [QSA,L]
RewriteRule
rsp/date/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?year=$1&monthnum=$2&feed=$3 [QSA,L]
RewriteRule rsp/date/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?year=$1&monthnum=$2&feed=$3 [QSA,L]
RewriteRule
rsp/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$ /wp/index.php?year=$1&monthnum=$2&paged=$3 [QSA,L]
RewriteRule rsp/date/([0-9]{4})/([0-9]{1,2})/?$ /wp/index.php?year=$1&monthnum=$2 [QSA,L]
RewriteRule
rsp/date/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?year=$1&feed=$2 [QSA,L]
RewriteRule rsp/date/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?year=$1&feed=$2 [QSA,L]
RewriteRule
rsp/date/([0-9]{4})/page/?([0-9]{1,})/?$ /wp/index.php?year=$1&paged=$2 [QSA,L]
RewriteRule rsp/date/([0-9]{4})/?$ /wp/index.php?year=$1 [QSA,L]
RewriteRule
rsp/([0-9]+)/trackback/?$ /wp/index.php?p=$1&tb=1 [QSA,L]
RewriteRule rsp/([0-9]+)/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?p=$1&feed=$2 [QSA,L]
RewriteRule
rsp/([0-9]+)/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?p=$1&feed=$2 [QSA,L]
RewriteRule rsp/([0-9]+)/page/?([0-9]{1,})/?$ /wp/index.php?p=$1&paged=$2 [QSA,L]
RewriteRule
rsp/([0-9]+)(/[0-9]+)?/?$ /wp/index.php?p=$1&page=$2 [QSA,L]

Permalinks work on the site. I suspect it is something with the .htaccess as well, but I am not an expert by any means. If it isn't anything obvious, please resolve as invalid since it may be ISP or web server specific and nothing to do with WordPress.

#3 @Frobenius
21 years ago

  • Resolution → fixed
  • Status new → closed

Fixed by upgrading to WordPress 2.0

Note: See TracTickets for help on using tickets.