From 21bf561294cd35238277de1b536e9ebda462bd3a Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 7 Dec 2011 13:47:58 +0000 Subject: [PATCH] =?UTF-8?q?V=C3=A9rification=20magpie=20rss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/IdentiteController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/application/controllers/IdentiteController.php b/application/controllers/IdentiteController.php index 55f994f13..bce7580ba 100644 --- a/application/controllers/IdentiteController.php +++ b/application/controllers/IdentiteController.php @@ -647,7 +647,7 @@ class IdentiteController extends Zend_Controller_Action $session = new SessionEntreprise($this->siret, $this->id); $url = 'http://news.google.fr/news?hl=fr&ned=fr&q='. - urlencode('"'.$session->getRaisonSociale().'"').'&output=rss'; + urlencode('"'.$session->getRaisonSociale().'"').'&output=rss'; define('MAGPIE_CACHE_ON', false); define('MAGPIE_OUTPUT_ENCODING', 'UTF-8'); @@ -655,8 +655,10 @@ class IdentiteController extends Zend_Controller_Action define('MAGPIE_DETECT_ENCODING', false); require_once ('Vendors/magpierss/rss_fetch.inc'); $rss = fetch_rss($url); - $items = array_slice($rss->items, 0, 15); - + $items = array(); + if ($rss!==false){ + $items = array_slice($rss->items, 0, 15); + } $this->view->assign('items', $items); }