aboutsummaryrefslogtreecommitdiffstats
path: root/mod/probe.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/probe.php')
-rw-r--r--mod/probe.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/mod/probe.php b/mod/probe.php
index f90728df2..8e0b60dcc 100644
--- a/mod/probe.php
+++ b/mod/probe.php
@@ -1,6 +1,5 @@
<?php
-require_once('include/Scrape.php');
require_once('include/zot.php');
function probe_content(&$a) {
@@ -16,11 +15,22 @@ function probe_content(&$a) {
if(x($_GET,'addr')) {
$channel = $a->get_channel();
$addr = trim($_GET['addr']);
- $res = zot_finger($addr,$channel);
+ $res = zot_finger($addr,$channel,false);
$o .= '<pre>';
- $j = json_decode($res['body'],true);
+ if($res['success'])
+ $j = json_decode($res['body'],true);
+ else {
+ $o .= sprintf( t('Fetching URL returns error: %1$s'),$res['error'] . "\r\n\r\n");
+ $o .= "<strong>https connection failed. Trying again with auto failover to http.</strong>\r\n\r\n";
+ $res = zot_finger($addr,$channel,true);
+ if($res['success'])
+ $j = json_decode($res['body'],true);
+ else
+ $o .= sprintf( t('Fetching URL returns error: %1$s'),$res['error'] . "\r\n\r\n");
+
+ }
if($j && $j['permissions'] && $j['permissions']['iv'])
- $j['permissions'] = json_decode(aes_unencapsulate($j['permissions'],$channel['channel_prvkey']),true);
+ $j['permissions'] = json_decode(crypto_unencapsulate($j['permissions'],$channel['channel_prvkey']),true);
$o .= str_replace("\n",'<br />',print_r($j,true));
$o .= '</pre>';
}