introduction fails if confirmation differs by http vs https

This commit is contained in:
Friendika 2011-08-12 02:58:29 -07:00
parent 0db145dafa
commit fda593caed
4 changed files with 40 additions and 7 deletions

View file

@ -7,7 +7,7 @@ require_once('include/text.php');
require_once("include/pgettext.php");
define ( 'FRIENDIKA_VERSION', '2.2.1068' );
define ( 'FRIENDIKA_VERSION', '2.2.1069' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
define ( 'DB_UPDATE_VERSION', 1079 );

View file

@ -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'];

23
mod/probe.php Normal file
View file

@ -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;
}