From fd6a21f5228366f52c582cdc517a199261497ca0 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 15 Oct 2012 16:33:00 -0700 Subject: [PATCH] oops - missingfile from last checking, the important one --- include/redir.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/include/redir.php b/include/redir.php index ecc07dfbec..2ca9969e27 100644 --- a/include/redir.php +++ b/include/redir.php @@ -2,14 +2,22 @@ function auto_redir(&$a, $contact_nick) { + // disabling temporarily - seeing a lot of recursive redirects, triggered in my case + // because one of my contacts has the same nickname as me so it's redirecting to his site + // (I'm trying to load my own profile page and he is remote so it shouldn't redirect anyway). + // Need some time to sort this out. + + return; + if(local_user()) { - $r = q("SELECT id FROM contact WHERE uid = ( SELECT uid FROM user WHERE nickname = '%s' LIMIT 1 ) AND nick = '%s' AND network = '%s' LIMIT 1", + $r = q("SELECT id FROM contact WHERE uid = ( SELECT uid FROM user WHERE nickname = '%s' LIMIT 1 ) AND nick = '%s' AND network = '%s' and self = 0 LIMIT 1", dbesc($contact_nick), dbesc($a->user['nickname']), dbesc(NETWORK_DFRN) ); - if(!$r || $r[0]['id'] == remote_user()) + + if((!$r) || (! count($r)) || $r[0]['id'] == remote_user()) return; @@ -19,7 +27,7 @@ function auto_redir(&$a, $contact_nick) { intval(local_user()) ); - if(! $r) + if(! ($r && count($r))) return; $cid = $r[0]['id'];