diff options
author | Manuel Jiménez Friaza <mjfriaza@openmailbox.org> | 2018-12-13 12:34:04 +0100 |
---|---|---|
committer | Manuel Jiménez Friaza <mjfriaza@openmailbox.org> | 2018-12-13 12:34:04 +0100 |
commit | 618d673947dc627dcdac3f9b6da7f31123472b05 (patch) | |
tree | dfa52436ec997eec5795b5dee247b3e4f6fa6557 /include | |
parent | 4cd5529027efa19288ddce125f0d41ccb5519578 (diff) | |
parent | 6bea3d6bfc984e6f30867f00be5a92b5cd5be925 (diff) | |
download | volse-hubzilla-618d673947dc627dcdac3f9b6da7f31123472b05.tar.gz volse-hubzilla-618d673947dc627dcdac3f9b6da7f31123472b05.tar.bz2 volse-hubzilla-618d673947dc627dcdac3f9b6da7f31123472b05.zip |
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'include')
-rw-r--r-- | include/network.php | 29 | ||||
-rw-r--r-- | include/photo/photo_imagick.php | 1 |
2 files changed, 30 insertions, 0 deletions
diff --git a/include/network.php b/include/network.php index 183a47105..cd352e7db 100644 --- a/include/network.php +++ b/include/network.php @@ -1,4 +1,8 @@ <?php + +use Zotlabs\Lib\Zotfinger; +use Zotlabs\Lib\Libzot; + /** * @file include/network.php * @brief Network related functions. @@ -1196,6 +1200,31 @@ function discover_by_webbie($webbie, $protocol = '') { } } } + + foreach($x['links'] as $link) { + if(array_key_exists('rel',$link)) { + if($link['rel'] === PROTOCOL_ZOT6 && ((! $protocol) || (strtolower($protocol) === 'zot6'))) { + logger('zot6 found for ' . $webbie, LOGGER_DEBUG); + $record = Zotfinger::exec($link['href']); + + // Check the HTTP signature + + $hsig = $record['signature']; + if($hsig && ($hsig['signer'] === $url || $hsig['signer'] === $link['href']) && $hsig['header_valid'] === true && $hsig['content_valid'] === true) + $hsig_valid = true; + + if(! $hsig_valid) { + logger('http signature not valid: ' . print_r($hsig,true)); + continue; + } + + $x = Libzot::import_xchan($record['data']); + if($x['success']) { + return $x['hash']; + } + } + } + } } logger('webfinger: ' . print_r($x,true), LOGGER_DATA, LOG_INFO); diff --git a/include/photo/photo_imagick.php b/include/photo/photo_imagick.php index f04c00245..cb3ad27fb 100644 --- a/include/photo/photo_imagick.php +++ b/include/photo/photo_imagick.php @@ -36,6 +36,7 @@ class photo_imagick extends photo_driver { } catch (Exception $e) { logger('imagick readImageBlob() exception:' . print_r($e,true)); + return; } /** |