From 874da31fcd4f11caedeaa2f1bc3dd6701c5b6421 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 20 Feb 2008 08:11:02 +0000 Subject: [PATCH] Merged a notice fix --- blocks/rss_client/block_rss_client.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/blocks/rss_client/block_rss_client.php b/blocks/rss_client/block_rss_client.php index b2d0d65ae9..64989425a7 100644 --- a/blocks/rss_client/block_rss_client.php +++ b/blocks/rss_client/block_rss_client.php @@ -200,6 +200,12 @@ } } + // first we must verify that the rss feed is loaded + // by checking $rss and $rss->items exist before using them + if (empty($rss) || empty($rss->items)) { + return ''; + } + if ($shownumentries > 0 && $shownumentries < count($rss->items) ) { $rss->items = array_slice($rss->items, 0, $shownumentries); } @@ -230,11 +236,6 @@ $formatoptions->para = false; - // first we must verify that the rss feed is loaded - // by checking $rss and $rss->items exist before using them - if (empty($rss) || empty($rss->items)) { - return ''; - } /// Accessibility: markup as a list. $returnstring .= '