]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fixed PHP Notice "Undefined index: enclosures" (and a possible one for 'tags')
authorJeffery To <jeffery.to@gmail.com>
Sun, 2 Aug 2009 11:38:03 +0000 (19:38 +0800)
committerJeffery To <jeffery.to@gmail.com>
Sun, 2 Aug 2009 11:38:03 +0000 (19:38 +0800)
lib/twitterapi.php

index e6af33e8289fe78de0f7d07b236712a12248a269..4115d9dcb48d7e908d2a679887c602b908476fac 100644 (file)
@@ -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);
             }