Only populate attachments array element if there are attachments
This commit is contained in:
parent
baec1320ab
commit
9c670ba695
|
@ -188,8 +188,11 @@ class TwitterapiAction extends Action
|
||||||
|
|
||||||
# Enclosures
|
# Enclosures
|
||||||
$attachments = $notice->attachments();
|
$attachments = $notice->attachments();
|
||||||
|
|
||||||
|
if (!empty($attachments)) {
|
||||||
|
|
||||||
$twitter_status['attachments'] = array();
|
$twitter_status['attachments'] = array();
|
||||||
if($attachments){
|
|
||||||
foreach ($attachments as $attachment) {
|
foreach ($attachments as $attachment) {
|
||||||
if ($attachment->isEnclosure()) {
|
if ($attachment->isEnclosure()) {
|
||||||
$enclosure = array();
|
$enclosure = array();
|
||||||
|
|
Loading…
Reference in New Issue