]> git.mjollnir.org Git - s9y.git/commitdiff
Fix a Feed Category RSS bug. Thanks to hanno :)
authorgarvinhicking <garvinhicking>
Sun, 5 Jun 2005 18:40:27 +0000 (18:40 +0000)
committergarvinhicking <garvinhicking>
Sun, 5 Jun 2005 18:40:27 +0000 (18:40 +0000)
index.php

index afd4a47d3ee9b7622c3cf649136fa6bff74433c4..0f2524074db23a5da30a7053d15f4fc36b586413 100644 (file)
--- 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;
         }
     }