]> git.mjollnir.org Git - s9y.git/commitdiff
fix author/category RSS feeds
authorgarvinhicking <garvinhicking>
Thu, 20 Oct 2005 10:02:12 +0000 (10:02 +0000)
committergarvinhicking <garvinhicking>
Thu, 20 Oct 2005 10:02:12 +0000 (10:02 +0000)
docs/NEWS
index.php

index 0c69c4a61b05e446a1f4e921507ad0f549523b0d..de0ed0608ac0adb9e587f17a1ec19f8364a0fd9d 100644 (file)
--- 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)
index c80d67beb660a181d34c6d38aa8c47f478e25819..0250490a9348b696710cdba10c18781a7a1a21fe 100644 (file)
--- 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;
+                }
             }
         }
     }