// Once we have the author URI, go to the web and try to find their public key
// (first this will look it up locally if it is in the diaspora-contact cache)
// This will also convert diaspora public key from pkcs#1 to pkcs#8
// Once we have the author URI, go to the web and try to find their public key
// (first this will look it up locally if it is in the diaspora-contact cache)
// This will also convert diaspora public key from pkcs#1 to pkcs#8
{
// Check for Diaspora (and Friendica) typical paths
if (!preg_match('=(https?://.+)/(?:posts|display|objects)/([a-zA-Z0-9-_@.:%]+[a-zA-Z0-9])=i', $url, $matches)) {
{
// Check for Diaspora (and Friendica) typical paths
if (!preg_match('=(https?://.+)/(?:posts|display|objects)/([a-zA-Z0-9-_@.:%]+[a-zA-Z0-9])=i', $url, $matches)) {
if (!intval(DI::config()->get('system', 'diaspora_test'))) {
$content_type = (($public_batch) ? 'application/magic-envelope+xml' : 'application/json');
if (!intval(DI::config()->get('system', 'diaspora_test'))) {
$content_type = (($public_batch) ? 'application/magic-envelope+xml' : 'application/json');