From 2e49b7da472d9b5cbbc4fc6e88edccef3841cf09 Mon Sep 17 00:00:00 2001 From: nohn Date: Sun, 5 Nov 2006 08:31:15 +0000 Subject: [PATCH] * various backports --- include/functions.inc.php | 2 +- include/functions_entries.inc.php | 3 ++- rss.php | 10 +++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/include/functions.inc.php b/include/functions.inc.php index b671b31..0401053 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -237,7 +237,7 @@ function serendipity_walkRecursive($ary, $child_name = 'id', $parent_name = 'par global $serendipity; static $_resArray; - if ( sizeof($ary) == 0 ) { + if (!is_array($ary) || sizeof($ary) == 0 ) { return array(); } diff --git a/include/functions_entries.inc.php b/include/functions_entries.inc.php index c6d59a6..9c1a8e6 100644 --- a/include/functions_entries.inc.php +++ b/include/functions_entries.inc.php @@ -344,6 +344,7 @@ function serendipity_fetchEntries($range = null, $full = true, $limit = '', $fet e.last_modified, a.realname AS author, + a.username AS loginname, a.email"; } @@ -921,7 +922,7 @@ function serendipity_printEntries($entries, $extended = 0, $preview = false, $sm $authorData = array( 'authorid' => $entry['authorid'], - 'username' => $entry['author'], + 'username' => $entry['loginname'], 'email' => $entry['email'], 'realname' => $entry['author'] ); diff --git a/rss.php b/rss.php index 10502ec..1dfe2b9 100644 --- a/rss.php +++ b/rss.php @@ -28,6 +28,10 @@ if (!isset($_GET['type'])) { $_GET['type'] = 'content'; } +if (!empty($_SERVER['HTTP_USER_AGENT']) && stristr($_SERVER['HTTP_USER_AGENT'], 'feedburner')) { + $_GET['nocache'] = true; +} + if (!isset($_GET['nocache'])) { switch ($_GET['type']) { case 'comments': @@ -131,9 +135,9 @@ if (is_array($plugins)) { $metadata['fullFeed'] = $plugin->get_config('fullfeed', false); if ($_GET['type'] == 'content' && $plugin->get_config('show_feedburner') === 'force' && !preg_match('@FeedBurn@i', $_SERVER['HTTP_USER_AGENT'])) { - $url = 'http://feeds.feedburner.com/' . $plugin->get_config('fb_id'); - header('Location: ' . $url); - exit; + $url = 'http://feeds.feedburner.com/' . $plugin->get_config('fb_id'); + header('Location: ' . $url); + exit; } $metadata['showMail'] = serendipity_db_bool($plugin->get_config('show_mail', $metadata['showMail'])); break; -- 2.39.5