From: garvinhicking Date: Thu, 20 Oct 2005 10:02:12 +0000 (+0000) Subject: fix author/category RSS feeds X-Git-Tag: 0.9~47 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=12fcbba7a278d4e321abb2e3bd42be5901316c2d;p=s9y.git fix author/category RSS feeds --- diff --git a/docs/NEWS b/docs/NEWS index 0c69c4a..de0ed06 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -2,6 +2,9 @@ Version 0.9-beta3 () ------------------------------------------------------------------------ + + * Fix Bug with category/author RSS feeds not properly recognize + their content when URL rewriting is off (garvinhicking) * Enhanced entryproperties plugin to support entering custom field- names (RFE #1328773) (garvinhicking) diff --git a/index.php b/index.php index c80d67b..0250490 100644 --- a/index.php +++ b/index.php @@ -251,17 +251,17 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range } if (is_array($matches)) { - $uri = preg_replace('@(/?' . $serendipity['serendipityHTTPPath'] . preg_quote(PATH_FEEDS, '@') . '/)(.+)\.rss@i', '\2', $uri); - if (strpos($uri, $serendipity['permalinkCategoriesPath']) === 0) { - $catid = serendipity_searchPermalink($serendipity['permalinkFeedCategoryStructure'], $uri, $matches[1], 'category'); - if (is_numeric($catid) && $catid > 0) { - $_GET['category'] = $catid; - } - } - elseif (strpos($uri, $serendipity['permalinkAuthorsPath']) === 0) { - $authorid = serendipity_searchPermalink($serendipity['permalinkFeedAuthorStructure'], $uri, $matches[1], 'author'); - if (is_numeric($authorid) && $authorid > 0) { - $_GET['viewAuthor'] = $authorid; + if (preg_match('@(/?' . preg_quote(PATH_FEEDS, '@') . '/)(.+)\.rss@i', $uri, $uriparts)) { + if (strpos($uriparts[2], $serendipity['permalinkCategoriesPath']) === 0) { + $catid = serendipity_searchPermalink($serendipity['permalinkFeedCategoryStructure'], $uriparts[2], $matches[1], 'category'); + if (is_numeric($catid) && $catid > 0) { + $_GET['category'] = $catid; + } + } elseif (strpos($uriparts[2], $serendipity['permalinkAuthorsPath']) === 0) { + $authorid = serendipity_searchPermalink($serendipity['permalinkFeedAuthorStructure'], $uriparts[2], $matches[1], 'author'); + if (is_numeric($authorid) && $authorid > 0) { + $_GET['viewAuthor'] = $authorid; + } } } }