]> git.mxchange.org Git - friendica.git/commitdiff
Issue 7771: Funkwhale support
authorMichael <heluecht@pirati.ca>
Tue, 24 Mar 2020 23:12:53 +0000 (23:12 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 24 Mar 2020 23:12:53 +0000 (23:12 +0000)
src/Content/Text/BBCode.php
src/Model/APContact.php
src/Protocol/ActivityPub/Receiver.php

index 9cf7df4e3e8846c4729ee75378b632a5cbeb000f..7a316c251b737a7e1766b6d68cd4834b36cf59b3 100644 (file)
@@ -1631,7 +1631,7 @@ class BBCode
                // Try to Oembed
                if ($try_oembed) {
                        $text = preg_replace("/\[video\](.*?\.(ogg|ogv|oga|ogm|webm|mp4).*?)\[\/video\]/ism", '<video src="$1" controls="controls" width="' . $a->videowidth . '" height="' . $a->videoheight . '" loop="true"><a href="$1">$1</a></video>', $text);
-                       $text = preg_replace("/\[audio\](.*?\.(ogg|ogv|oga|ogm|webm|mp4|mp3).*?)\[\/audio\]/ism", '<audio src="$1" controls="controls"><a href="$1">$1</a></audio>', $text);
+                       $text = preg_replace("/\[audio\](.*?)\[\/audio\]/ism", '<audio src="$1" controls="controls"><a href="$1">$1</a></audio>', $text);
 
                        $text = preg_replace_callback("/\[video\](.*?)\[\/video\]/ism", $try_oembed_callback, $text);
                        $text = preg_replace_callback("/\[audio\](.*?)\[\/audio\]/ism", $try_oembed_callback, $text);
index 7ce47bb227ec04e39804680947228533ac696328..071d9351651b07055d0ff10bd15a2c406a6bcf06 100644 (file)
@@ -26,6 +26,7 @@ use Friendica\Core\Logger;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Protocol\ActivityPub;
+use Friendica\Util\Crypto;
 use Friendica\Util\Network;
 use Friendica\Util\JsonLD;
 use Friendica\Util\DateTimeFormat;
@@ -209,6 +210,9 @@ class APContact
                $apcontact['pubkey'] = null;
                if (!empty($compacted['w3id:publicKey'])) {
                        $apcontact['pubkey'] = trim(JsonLD::fetchElement($compacted['w3id:publicKey'], 'w3id:publicKeyPem', '@value'));
+                       if (strstr($apcontact['pubkey'], 'RSA ')) {
+                               $apcontact['pubkey'] = Crypto::rsaToPem($apcontact['pubkey']);
+                       }
                }
 
                $apcontact['manually-approve'] = (int)JsonLD::fetchElement($compacted, 'as:manuallyApprovesFollowers');
index 30728ff11afedadaff91508bde266bd193045305..508e5acd53de2d84823123909228ed8f2f90e7eb 100644 (file)
@@ -841,6 +841,10 @@ class Receiver
                                continue;
                        }
 
+                       if (empty($element['href'])) {
+                               $element['href'] = $element['name'];
+                       }
+
                        $taglist[] = $element;
                }
                return $taglist;