- $salmon = replace_macros($salmon_tpl,array(
- '$data' => $data,
- '$encoding' => $encoding,
- '$algorithm' => $algorithm,
- '$keyhash' => $keyhash,
- '$signature' => $signature2
+ // Now try the compliant mode that normally isn't used for GNU Social
+ $xmldata = array("me:env" => array("me:data" => $data,
+ "@attributes" => array("type" => $data_type),
+ "me:encoding" => $encoding,
+ "me:alg" => $algorithm,
+ "me:sig" => $signature2,
+ "@attributes2" => array("key_id" => $keyhash)));
+
+ $namespaces = array("me" => "http://salmon-protocol.org/ns/magic-env");
+
+ $salmon = xml::from_array($xmldata, $xml, false, $namespaces);
+
+ // slap them
+ post_url($url, $salmon, array(
+ 'Content-type: application/magic-envelope+xml',
+ 'Content-length: ' . strlen($salmon)