diff options
author | Jeffery To <jeffery.to@gmail.com> | 2009-08-02 19:38:03 +0800 |
---|---|---|
committer | Jeffery To <jeffery.to@gmail.com> | 2009-08-02 19:38:03 +0800 |
commit | 6c1bd6759127968908a0d7f179447a7a6f653d17 (patch) | |
tree | 07f613a31f57e5201fe9961f1d292e3b0bcdca8e /lib | |
parent | b2d2b19d3a8fae84e1bc6532661c71ac180eceec (diff) |
Fixed PHP Notice "Undefined index: enclosures" (and a possible one for 'tags')
Diffstat (limited to 'lib')
-rw-r--r-- | lib/twitterapi.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/twitterapi.php b/lib/twitterapi.php index e6af33e82..4115d9dcb 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); } |