From b8f5db903b8ca72fbbff10edac40088383a79ae1 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Sun, 5 Jun 2005 18:40:27 +0000 Subject: [PATCH] Fix a Feed Category RSS bug. Thanks to hanno :) --- index.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index afd4a47..0f25240 100644 --- a/index.php +++ b/index.php @@ -202,17 +202,17 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range fclose($fp); } print $data; -} elseif (preg_match(PAT_FEEDS, $uri) || preg_match(PAT_PERMALINK_FEEDCATEGORIES, $uri, $matches)) { +} elseif (preg_match(PAT_PERMALINK_FEEDCATEGORIES, $uri, $matches) || preg_match(PAT_FEEDS, $uri)) { header('Content-Type: text/html; charset=utf-8'); - if (preg_match('@/(index|atom|rss|comments|opml)\.(rss[0-9]?|rdf|rss|xml|atom)$@', $uri, $matches)) { - list($_GET['version'], $_GET['type']) = serendipity_discover_rss($matches[1], $matches[2]); + if (preg_match('@/(index|atom|rss|comments|opml)\.(rss[0-9]?|rdf|rss|xml|atom)$@', $uri, $vmatches)) { + list($_GET['version'], $_GET['type']) = serendipity_discover_rss($vmatches[1], $vmatches[2]); } if (is_array($matches)) { - $uri = preg_replace('@(' . preg_quote(PATH_FEEDS, '@') . '/)(.+)\.rss@i', '\2', $uri); - $catid = serendipity_searchPermalink($serendipity['permalinkFeedCategoryStructure'], $uri, false, 'category'); - if ($catid) { + $uri = preg_replace('@(/?' . preg_quote(PATH_FEEDS, '@') . '/)(.+)\.rss@i', '\2', $uri); + $catid = serendipity_searchPermalink($serendipity['permalinkFeedCategoryStructure'], $uri, $matches[1], 'category'); + if (is_numeric($catid) && $catid > 0) { $_GET['category'] = $catid; } } -- 2.39.5