]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/APContact.php
Support Blurhash
[friendica.git] / src / Model / APContact.php
index 742efcf190cae7561dcc2e679c2c5010046788c1..67ce2b66bf73d9c689ef5f778404edc42c1fb358 100644 (file)
@@ -305,8 +305,8 @@ 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'] = trim(JsonLD::fetchElement($compacted['w3id:publicKey'], 'w3id:publicKeyPem', '@value') ?? '');
+                       if (strpos($apcontact['pubkey'], 'RSA ') !== false) {
                                $apcontact['pubkey'] = Crypto::rsaToPem($apcontact['pubkey']);
                        }
                }
@@ -383,7 +383,7 @@ class APContact
                // kroeg:blocks, updated
 
                // When the photo is too large, try to shorten it by removing parts
-               if (strlen($apcontact['photo']) > 255) {
+               if (strlen($apcontact['photo'] ?? '') > 255) {
                        $parts = parse_url($apcontact['photo']);
                        unset($parts['fragment']);
                        $apcontact['photo'] = (string)Uri::fromParts($parts);
@@ -574,7 +574,7 @@ class APContact
         *
         * @param array $apcontact
         *
-        * @return bool 
+        * @return bool
         */
        public static function isRelay(array $apcontact): bool
        {