X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fredir.php;h=5427d8c786e93f5be407bca3b099f4f8fc071314;hb=f4fd67992812c5c356ff51e875077921a2222d90;hp=5c8849ecad5caae5c6a4b1e11cc9f2fd780a03b9;hpb=2c96ad77396b0df2be481c4f90cc61ebaa83bc75;p=friendica.git diff --git a/mod/redir.php b/mod/redir.php index 5c8849ecad..5427d8c786 100644 --- a/mod/redir.php +++ b/mod/redir.php @@ -4,14 +4,15 @@ function redir_init(&$a) { if((! local_user()) || (! ($a->argc == 2)) || (! intval($a->argv[1]))) goaway($a->get_baseurl()); - $r = q("SELECT `issued-id`, `dfrn-id`, `duplex`, `poll` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", + $r = q("SELECT `network`, `issued-id`, `dfrn-id`, `duplex`, `poll` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($a->argv[1]), - intval($_SESSION['uid'])); - if(! count($r)) + intval(local_user()) + ); + if((! count($r)) || ($r[0]['network'] !== 'dfrn')) goaway($a->get_baseurl()); + $dfrn_id = $orig_id = (($r[0]['issued-id']) ? $r[0]['issued-id'] : $r[0]['dfrn-id']); - $dfrn_id = $orig_id = $r[0]['issued-id']; if($r[0]['duplex'] && $r[0]['issued-id']) { $orig_id = $r[0]['issued-id']; $dfrn_id = '1:' . $orig_id; @@ -25,7 +26,7 @@ function redir_init(&$a) { intval($_SESSION['uid']), dbesc($dfrn_id), intval(time() + 45)); - goaway ($r[0]['poll'] . '?dfrn_id=' . $dfrn_id . '&type=profile'); - + goaway ($r[0]['poll'] . '?dfrn_id=' . $dfrn_id + . '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile'); -} \ No newline at end of file +}