]> git.mxchange.org Git - friendica.git/blobdiff - include/redir.php
More usage of dbm::is_result($r) instead of count($r):
[friendica.git] / include / redir.php
index 3e8ddf26120a63558785f48eb5f68192a0dbb47f..8d8a035f1db5fa83c07e388111526c5855416b29 100644 (file)
@@ -4,7 +4,7 @@ function auto_redir(&$a, $contact_nick) {
 
        // prevent looping
 
-       if(intval($_REQUEST,'redir'))
+       if(x($_REQUEST,'redir') && intval($_REQUEST['redir']))
                return;
 
        if((! $contact_nick) || ($contact_nick === $a->user['nickname']))
@@ -36,7 +36,7 @@ function auto_redir(&$a, $contact_nick) {
                dbesc($nurl)
                );
 
-               if((!$r) || (! count($r)) || $r[0]['id'] == remote_user())
+               if((! dbm::is_result($r)) || $r[0]['id'] == remote_user())
                        return;
 
 
@@ -48,7 +48,7 @@ function auto_redir(&$a, $contact_nick) {
                       dbesc($baseurl)
                );
 
-               if(! ($r && count($r)))
+               if(! dbm::is_result($r))
                        return;
 
                $cid = $r[0]['id'];