mirror of
https://github.com/friendica/friendica
synced 2025-04-29 10:24:23 +02:00
Changes:
- added missing type-hints - added documentation - removed parameter $baseURL while it can be locally get the same way but lesser parameter - used ActivityNamespace::SALMON_ME - changed double-quotes to single
This commit is contained in:
parent
074bae33c9
commit
cfa575b8e5
10 changed files with 71 additions and 35 deletions
|
@ -145,14 +145,18 @@ class Salmon
|
|||
$signature3 = Strings::base64UrlEncode(Crypto::rsaSign($data, $owner['sprvkey']));
|
||||
|
||||
// At first try the non compliant method that works for GNU Social
|
||||
$xmldata = ["me:env" => ["me:data" => $data,
|
||||
"@attributes" => ["type" => $data_type],
|
||||
"me:encoding" => $encoding,
|
||||
"me:alg" => $algorithm,
|
||||
"me:sig" => $signature,
|
||||
"@attributes2" => ["key_id" => $keyhash]]];
|
||||
$xmldata = [
|
||||
'me:env' => [
|
||||
'me:data' => $data,
|
||||
'@attributes' => ['type' => $data_type],
|
||||
'me:encoding' => $encoding,
|
||||
'me:alg' => $algorithm,
|
||||
'me:sig' => $signature,
|
||||
'@attributes2' => ['key_id' => $keyhash],
|
||||
]
|
||||
];
|
||||
|
||||
$namespaces = ["me" => "http://salmon-protocol.org/ns/magic-env"];
|
||||
$namespaces = ['me' => ActivityNamespace::SALMON_ME];
|
||||
|
||||
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
|
||||
|
||||
|
@ -170,14 +174,18 @@ class Salmon
|
|||
Logger::notice('GNU Social salmon failed. Falling back to compliant mode');
|
||||
|
||||
// Now try the compliant mode that normally isn't used for GNU Social
|
||||
$xmldata = ["me:env" => ["me:data" => $data,
|
||||
"@attributes" => ["type" => $data_type],
|
||||
"me:encoding" => $encoding,
|
||||
"me:alg" => $algorithm,
|
||||
"me:sig" => $signature2,
|
||||
"@attributes2" => ["key_id" => $keyhash]]];
|
||||
$xmldata = [
|
||||
'me:env' => [
|
||||
'me:data' => $data,
|
||||
'@attributes' => ['type' => $data_type],
|
||||
'me:encoding' => $encoding,
|
||||
'me:alg' => $algorithm,
|
||||
'me:sig' => $signature2,
|
||||
'@attributes2' => ['key_id' => $keyhash]
|
||||
]
|
||||
];
|
||||
|
||||
$namespaces = ["me" => "http://salmon-protocol.org/ns/magic-env"];
|
||||
$namespaces = ['me' => ActivityNamespace::SALMON_ME];
|
||||
|
||||
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
|
||||
|
||||
|
@ -193,14 +201,18 @@ class Salmon
|
|||
Logger::notice('compliant salmon failed. Falling back to old status.net');
|
||||
|
||||
// Last try. This will most likely fail as well.
|
||||
$xmldata = ["me:env" => ["me:data" => $data,
|
||||
"@attributes" => ["type" => $data_type],
|
||||
"me:encoding" => $encoding,
|
||||
"me:alg" => $algorithm,
|
||||
"me:sig" => $signature3,
|
||||
"@attributes2" => ["key_id" => $keyhash]]];
|
||||
$xmldata = [
|
||||
'me:env' => [
|
||||
'me:data' => $data,
|
||||
'@attributes' => ['type' => $data_type],
|
||||
'me:encoding' => $encoding,
|
||||
'me:alg' => $algorithm,
|
||||
'me:sig' => $signature3,
|
||||
'@attributes2' => ['key_id' => $keyhash],
|
||||
]
|
||||
];
|
||||
|
||||
$namespaces = ["me" => "http://salmon-protocol.org/ns/magic-env"];
|
||||
$namespaces = ['me' => ActivityNamespace::SALMON_ME];
|
||||
|
||||
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue