XML::addElement($doc, $author, 'poco:utcOffset', DateTimeFormat::timezoneNow($profile['timezone'], 'P'));
- if (trim($profile['homepage']) != '') {
+ if (trim($profile['homepage'])) {
$urls = $doc->createElement('poco:urls');
XML::addElement($doc, $urls, 'poco:type', 'homepage');
XML::addElement($doc, $urls, 'poco:value', $profile['homepage']);
$author->appendChild($urls);
}
- if (trim($profile['pub_keywords']) != '') {
+ if (trim($profile['pub_keywords'] ?? '')) {
$keywords = explode(',', $profile['pub_keywords']);
foreach ($keywords as $keyword) {
}
}
- if (trim($profile['xmpp']) != '') {
+ if (trim($profile['xmpp'])) {
$ims = $doc->createElement('poco:ims');
XML::addElement($doc, $ims, 'poco:type', 'xmpp');
XML::addElement($doc, $ims, 'poco:value', $profile['xmpp']);
$author->appendChild($ims);
}
- if (trim($profile['locality'] . $profile['region'] . $profile['country-name']) != '') {
+ if (trim($profile['locality'] . $profile['region'] . $profile['country-name'])) {
$element = $doc->createElement('poco:address');
XML::addElement($doc, $element, 'poco:formatted', Profile::formatLocation($profile));
$entry->setAttribute("xmlns:statusnet", ActivityNamespace::STATUSNET);
}
- $body = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body'] ?? '');
+ $body = Post\Media::addAttachmentsToBody($item['uri-id'], DI::contentItem()->addSharedPost($item));
if ($item['private'] == Item::PRIVATE) {
$body = Item::fixPrivatePhotos($body, $owner['uid'], $item, $cid);
$item['uri-id'] = ItemURI::insert(['uri' => $item['uri'], 'guid' => $item['guid']]);
- $item['body'] = Item::improveSharedDataInBody($item);
+ $quote_uri_id = Item::getQuoteUriId($item['body'], $item['uid']);
+ if (!empty($quote_uri_id)) {
+ $item['quote-uri-id'] = $quote_uri_id;
+ $item['body'] = BBCode::removeSharedData($item['body']);
+ }
Tag::storeFromBody($item['uri-id'], $item['body']);