From: Jeffery To Date: Sun, 2 Aug 2009 11:38:03 +0000 (+0800) Subject: Fixed PHP Notice "Undefined index: enclosures" (and a possible one for 'tags') X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6c1bd6759127968908a0d7f179447a7a6f653d17;p=quix0rs-gnu-social.git Fixed PHP Notice "Undefined index: enclosures" (and a possible one for 'tags') --- diff --git a/lib/twitterapi.php b/lib/twitterapi.php index e6af33e828..4115d9dcb4 100644 --- a/lib/twitterapi.php +++ b/lib/twitterapi.php @@ -479,12 +479,12 @@ class TwitterapiAction extends Action $this->element('link', null, $entry['link']); # RSS only supports 1 enclosure per item - if($entry['enclosures']){ + if(array_key_exists('enclosures', $entry) and !empty($entry['enclosures'])){ $enclosure = $entry['enclosures'][0]; $this->element('enclosure', array('url'=>$enclosure['url'],'type'=>$enclosure['mimetype'],'length'=>$enclosure['size']), null); } - if($entry['tags']){ + if(array_key_exists('tags', $entry)){ foreach($entry['tags'] as $tag){ $this->element('category', null,$tag); }