diff options
Diffstat (limited to 'mod/redir.php')
-rw-r--r-- | mod/redir.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mod/redir.php b/mod/redir.php index c9b284ddd..e743d003e 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(get_uid()) + ); + 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; |