$reply->cc = $post->cc;
}
- $reply->to = $post->to;
+ if (isset($post->to)) {
+ $reply->to = $post->to;
+ }
+
$reply->object = new stdClass;
$reply->object->objectType = $post->object->inReplyTo->objectType;
$reply->object->content = $post->object->inReplyTo->content;
$share_author = $post->object->author->url;
}
+ if (isset($post->object->created)) {
+ $created = DateTimeFormat::utc($post->object->created);
+ } else {
+ $created = '';
+ }
+
$postarray['body'] = share_header($share_author, $post->object->author->url,
$post->object->author->image->url, "",
- DateTimeFormat::utc($post->object->created),
- $post->links->self->href).
+ $created, $post->links->self->href).
$postarray['body']."[/share]";
}
$tempfile = tempnam(get_temppath(), "cache");
file_put_contents($tempfile, $img_str);
- $mime = image_type_to_mime_type(exif_imagetype($tempfile));
+ $mime = mime_content_type($tempfile);
unlink($tempfile);
if (substr($mime, 0, 6) == "image/") {
$postarray = twitter_createpost($a, $uid, $post, $self, false, false, false);
- if (trim($postarray['body']) == "") {
+ if (empty($postarray['body'])) {
continue;
}