// prevent looping
- if(intval($_REQUEST,'redir'))
+ if(x($_REQUEST,'redir') && intval($_REQUEST['redir']))
return;
if((! $contact_nick) || ($contact_nick === $a->user['nickname']))
//
// We also have to make sure that I'm a legitimate contact--I'm not blocked or pending.
- $baseurl = $a->get_baseurl();
+ $baseurl = App::get_baseurl();
$domain_st = strpos($baseurl, "://");
if($domain_st === false)
return;
dbesc($nurl)
);
- if((!$r) || (! count($r)) || $r[0]['id'] == remote_user())
+ if ((! dbm::is_result($r)) || $r[0]['id'] == remote_user()) {
return;
-
+ }
$r = q("SELECT * FROM contact WHERE nick = '%s'
AND network = '%s' AND uid = %d AND url LIKE '%%%s%%' LIMIT 1",
dbesc($baseurl)
);
- if(! ($r && count($r)))
+ if (! dbm::is_result($r)) {
return;
+ }
$cid = $r[0]['id'];
$dfrn_id = '0:' . $orig_id;
}
+ // ensure that we've got a valid ID. There may be some edge cases with forums and non-duplex mode
+ // that may have triggered some of the "went to {profile/intro} and got an RSS feed" issues
+
+ if(strlen($dfrn_id) < 3)
+ return;
+
$sec = random_string();
q("INSERT INTO `profile_check` ( `uid`, `cid`, `dfrn_id`, `sec`, `expire`)