Handle exception from Magic Envelope toXML function
This commit is contained in:
parent
6dcb293ba0
commit
a4051945fd
@ -225,7 +225,12 @@ class DiasporaPlugin extends Plugin
|
|||||||
|
|
||||||
public function onSalmonSlap($endpoint_uri, MagicEnvelope $magic_env, Profile $target=null)
|
public function onSalmonSlap($endpoint_uri, MagicEnvelope $magic_env, Profile $target=null)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
$envxml = $magic_env->toXML($target, 'diaspora');
|
$envxml = $magic_env->toXML($target, 'diaspora');
|
||||||
|
} catch (Exception $e) {
|
||||||
|
common_log(LOG_ERR, sprintf('Could not generate Magic Envelope XML (diaspora flavour) for profile id=='.$target->getID().': '.$e->getMessage()));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Diaspora wants another POST format (base64url-encoded POST variable 'xml')
|
// Diaspora wants another POST format (base64url-encoded POST variable 'xml')
|
||||||
$headers = array('Content-Type: application/x-www-form-urlencoded');
|
$headers = array('Content-Type: application/x-www-form-urlencoded');
|
||||||
|
@ -1407,7 +1407,12 @@ class OStatusPlugin extends Plugin
|
|||||||
|
|
||||||
public function onSalmonSlap($endpoint_uri, MagicEnvelope $magic_env, Profile $target=null)
|
public function onSalmonSlap($endpoint_uri, MagicEnvelope $magic_env, Profile $target=null)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
$envxml = $magic_env->toXML($target);
|
$envxml = $magic_env->toXML($target);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
common_log(LOG_ERR, sprintf('Could not generate Magic Envelope XML for profile id=='.$target->getID().': '.$e->getMessage()));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$headers = array('Content-Type: application/magic-envelope+xml');
|
$headers = array('Content-Type: application/magic-envelope+xml');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user