Address some PHP 8.1 deprecation notices
- Replace a strstr call by strpos in Model\APContact - Simplify conditions in Protocol\DFRN - Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1331012289
This commit is contained in:
@@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user