]> git.mxchange.org Git - friendica.git/blobdiff - mod/dfrn_poll.php
Fix profile wrong DISTINCT + ORDER BY
[friendica.git] / mod / dfrn_poll.php
index f74429e5803b43a660c51edd579840ccc21f3b5a..506f9f162f2159dc1cd8fc75229cff93d11f202c 100644 (file)
@@ -4,7 +4,7 @@ require_once('include/auth.php');
 require_once('include/dfrn.php');
 
 
-function dfrn_poll_init(App &$a) {
+function dfrn_poll_init(App $a) {
 
 
        $dfrn_id         = ((x($_GET,'dfrn_id'))         ? $_GET['dfrn_id']              : '');
@@ -137,7 +137,7 @@ function dfrn_poll_init(App &$a) {
                        $c = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
                                intval($r[0]['cid'])
                        );
-                       if(! count($c)) {
+                       if (! dbm::is_result($c)) {
                                xml_status(3, 'No profile');
                        }
                        $contact = $c[0];
@@ -163,7 +163,7 @@ function dfrn_poll_init(App &$a) {
 
                        if($final_dfrn_id != $orig_id) {
                                logger('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, LOGGER_DEBUG);
-                               // did not decode properly - cannot trust this site 
+                               // did not decode properly - cannot trust this site
                                xml_status(3, 'Bad decryption');
                        }
 
@@ -203,7 +203,7 @@ function dfrn_poll_init(App &$a) {
 
 
 
-function dfrn_poll_post(App &$a) {
+function dfrn_poll_post(App $a) {
 
        $dfrn_id      = ((x($_POST,'dfrn_id'))      ? $_POST['dfrn_id']              : '');
        $challenge    = ((x($_POST,'challenge'))    ? $_POST['challenge']            : '');
@@ -234,7 +234,7 @@ function dfrn_poll_post(App &$a) {
                        $c = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
                                intval($r[0]['cid'])
                        );
-                       if(! count($c)) {
+                       if (! dbm::is_result($c)) {
                                xml_status(3, 'No profile');
                        }
                        $contact = $c[0];
@@ -260,7 +260,7 @@ function dfrn_poll_post(App &$a) {
 
                        if($final_dfrn_id != $orig_id) {
                                logger('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, LOGGER_DEBUG);
-                               // did not decode properly - cannot trust this site 
+                               // did not decode properly - cannot trust this site
                                xml_status(3, 'Bad decryption');
                        }
 
@@ -383,7 +383,7 @@ function dfrn_poll_post(App &$a) {
        }
 }
 
-function dfrn_poll_content(App &$a) {
+function dfrn_poll_content(App $a) {
 
        $dfrn_id         = ((x($_GET,'dfrn_id'))         ? $_GET['dfrn_id']              : '');
        $type            = ((x($_GET,'type'))            ? $_GET['type']                 : 'data');