Merge branch 'friendica:develop' into show_image_upload_limit

This commit is contained in:
MarekBenjamin 2022-11-30 18:19:18 +01:00 committed by GitHub
commit 8f5d6fdf72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 8 deletions

View File

@ -305,8 +305,8 @@ class APContact
$apcontact['pubkey'] = null; $apcontact['pubkey'] = null;
if (!empty($compacted['w3id:publicKey'])) { if (!empty($compacted['w3id:publicKey'])) {
$apcontact['pubkey'] = trim(JsonLD::fetchElement($compacted['w3id:publicKey'], 'w3id:publicKeyPem', '@value')); $apcontact['pubkey'] = trim(JsonLD::fetchElement($compacted['w3id:publicKey'], 'w3id:publicKeyPem', '@value') ?? '');
if (strstr($apcontact['pubkey'], 'RSA ')) { if (strpos($apcontact['pubkey'], 'RSA ') !== false) {
$apcontact['pubkey'] = Crypto::rsaToPem($apcontact['pubkey']); $apcontact['pubkey'] = Crypto::rsaToPem($apcontact['pubkey']);
} }
} }

View File

@ -2271,6 +2271,11 @@ class Item
return; return;
} }
$cdata = Contact::getPublicAndUserContactID($item['author-id'], $item['uid']);
if (empty($cdata['user']) || ($cdata['user'] != $item['contact-id'])) {
return;
}
if (!DBA::exists('contact', ['id' => $item['contact-id'], 'remote_self' => Contact::MIRROR_NATIVE_RESHARE])) { if (!DBA::exists('contact', ['id' => $item['contact-id'], 'remote_self' => Contact::MIRROR_NATIVE_RESHARE])) {
return; return;
} }

View File

@ -174,8 +174,8 @@ class Status extends BaseProfile
$condition = DBA::mergeConditions($condition, ["((`gravity` = ? AND `wall`) OR $condition = DBA::mergeConditions($condition, ["((`gravity` = ? AND `wall`) OR
(`gravity` = ? AND `vid` = ? AND `origin` (`gravity` = ? AND `vid` = ? AND `origin`
AND `thr-parent-id` IN (SELECT `uri-id` FROM `post` WHERE `gravity` = ? AND `network` = ?)))", AND `thr-parent-id` IN (SELECT `uri-id` FROM `post` WHERE `gravity` = ? AND `network` IN (?, ?))))",
Item::GRAVITY_PARENT, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), Item::GRAVITY_PARENT, Protocol::ACTIVITYPUB]); Item::GRAVITY_PARENT, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), Item::GRAVITY_PARENT, Protocol::ACTIVITYPUB, Protocol::DFRN]);
$condition = DBA::mergeConditions($condition, ['uid' => $profile['uid'], 'network' => Protocol::FEDERATED, $condition = DBA::mergeConditions($condition, ['uid' => $profile['uid'], 'network' => Protocol::FEDERATED,
'visible' => true, 'deleted' => false]); 'visible' => true, 'deleted' => false]);

View File

@ -226,6 +226,7 @@ class Introduction implements \JsonSerializable
/** /**
* @inheritDoc * @inheritDoc
*/ */
#[\ReturnTypeWillChange]
public function jsonSerialize() public function jsonSerialize()
{ {
return $this->toArray(); return $this->toArray();

View File

@ -538,7 +538,7 @@ class DFRN
XML::addElement($doc, $author, 'poco:utcOffset', DateTimeFormat::timezoneNow($profile['timezone'], 'P')); XML::addElement($doc, $author, 'poco:utcOffset', DateTimeFormat::timezoneNow($profile['timezone'], 'P'));
if (trim($profile['homepage']) != '') { if (trim($profile['homepage'])) {
$urls = $doc->createElement('poco:urls'); $urls = $doc->createElement('poco:urls');
XML::addElement($doc, $urls, 'poco:type', 'homepage'); XML::addElement($doc, $urls, 'poco:type', 'homepage');
XML::addElement($doc, $urls, 'poco:value', $profile['homepage']); XML::addElement($doc, $urls, 'poco:value', $profile['homepage']);
@ -546,7 +546,7 @@ class DFRN
$author->appendChild($urls); $author->appendChild($urls);
} }
if (trim($profile['pub_keywords']) != '') { if (trim($profile['pub_keywords'] ?? '')) {
$keywords = explode(',', $profile['pub_keywords']); $keywords = explode(',', $profile['pub_keywords']);
foreach ($keywords as $keyword) { foreach ($keywords as $keyword) {
@ -554,7 +554,7 @@ class DFRN
} }
} }
if (trim($profile['xmpp']) != '') { if (trim($profile['xmpp'])) {
$ims = $doc->createElement('poco:ims'); $ims = $doc->createElement('poco:ims');
XML::addElement($doc, $ims, 'poco:type', 'xmpp'); XML::addElement($doc, $ims, 'poco:type', 'xmpp');
XML::addElement($doc, $ims, 'poco:value', $profile['xmpp']); XML::addElement($doc, $ims, 'poco:value', $profile['xmpp']);
@ -562,7 +562,7 @@ class DFRN
$author->appendChild($ims); $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'); $element = $doc->createElement('poco:address');
XML::addElement($doc, $element, 'poco:formatted', Profile::formatLocation($profile)); XML::addElement($doc, $element, 'poco:formatted', Profile::formatLocation($profile));