diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/dfrn_confirm.php | 20 | ||||
-rw-r--r-- | mod/probe.php | 23 | ||||
-rw-r--r-- | mod/receive.php | 2 | ||||
-rw-r--r-- | mod/webfinger.php | 2 |
4 files changed, 40 insertions, 7 deletions
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 869bde3bf..bcc4e3438 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -528,12 +528,22 @@ function dfrn_confirm_post(&$a,$handsfree = null) { dbesc($decrypted_source_url), intval($local_uid) ); - if(! count($ret)) { - // this is either a bogus confirmation (?) or we deleted the original introduction. - $message = t('Contact record was not found for you on our site.'); - xml_status(3,$message); - return; // NOTREACHED + if(strstr($decrypted_source_url,'http:')) + $newurl = str_replace('http:','https:',$decrypted_source_url); + else + $newurl = str_replace('https:','http:',$decrypted_source_url); + + $ret = q("SELECT * FROM `contact` WHERE `url` = '%s' AND `uid` = %d LIMIT 1", + dbesc($newurl), + intval($local_uid) + ); + if(! count($r)) { + // this is either a bogus confirmation (?) or we deleted the original introduction. + $message = t('Contact record was not found for you on our site.'); + xml_status(3,$message); + return; // NOTREACHED + } } $relation = $ret[0]['rel']; diff --git a/mod/probe.php b/mod/probe.php new file mode 100644 index 000000000..221d18650 --- /dev/null +++ b/mod/probe.php @@ -0,0 +1,23 @@ +<?php + +require_once('include/Scrape.php'); + +function probe_content(&$a) { + + $o .= '<h3>Probe Diagnostic</h3>'; + + $o .= '<form action="probe" method="get">'; + $o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />'; + $o .= '<input type="submit" name="submit" value="Submit" /></form>'; + + $o .= '<br /><br />'; + + if(x($_GET,'addr')) { + $addr = trim($_GET['addr']); + $res = probe_url($addr); + $o .= '<pre>'; + $o .= str_replace("\n",'<br />',print_r($res,true)); + $o .= '</pre>'; + } + return $o; +} diff --git a/mod/receive.php b/mod/receive.php index 1dfbe59bd..72d528093 100644 --- a/mod/receive.php +++ b/mod/receive.php @@ -71,7 +71,7 @@ function receive_post(&$a) { $contact = ((count($r)) ? $r[0] : null); - + logger('diaspora msg: ' . $msg, LOGGER_DATA); if($xmlbase->request) { diaspora_request($importer,$contact,$xmlbase->request); diff --git a/mod/webfinger.php b/mod/webfinger.php index f6d6026b4..74bd2c954 100644 --- a/mod/webfinger.php +++ b/mod/webfinger.php @@ -23,4 +23,4 @@ function webfinger_content(&$a) { $o .= '</pre>'; } return $o; -}
\ No newline at end of file +} |