Browse Source

Merge pull request #2217 from annando/1512-key-hcard

Diaspora: Scrape the public key from the hcard
pull/2219/head
fabrixxm 5 years ago
parent
commit
0896f3a4f5
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      include/Scrape.php

+ 13
- 0
include/Scrape.php View File

@ -547,6 +547,19 @@ function probe_url($url, $mode = PROBE_NORMAL, $level = 1) {
}
}
// Scrape the public key from the hcard.
// Diaspora will remove it from the webfinger somewhere in the future.
if (($hcard != "") AND ($pubkey == "")) {
$ret = scrape_dfrn(($hcard) ? $hcard : $dfrn, true);
if (isset($ret["key"])) {
$hcard_key = $ret["key"];
if(strstr($hcard_key,'RSA '))
$pubkey = rsatopem($hcard_key);
else
$pubkey = $hcard_key;
}
}
if($diaspora && $diaspora_base && $diaspora_guid) {
if($mode == PROBE_DIASPORA || ! $notify) {
$notify = $diaspora_base . 'receive/users/' . $diaspora_guid;


Loading…
Cancel
Save