]> git.mxchange.org Git - friendica-addons.git/blobdiff - pumpio/pumpio.php
Merge pull request #486 from MrPetovan/task/fix-scrutinizer-issues
[friendica-addons.git] / pumpio / pumpio.php
index e60c631714dd9fa18fd5e143a1f41bc239604329..3f6f8a87040da7da5f5e39b42b3619d4c19f3fb3 100644 (file)
@@ -413,12 +413,13 @@ function pumpio_send(&$a,&$b) {
 
                logger("pumpio_send: receiver ".print_r($receiver, true));
 
-               if (!count($receiver) && ($b['private'] || !strstr($b['postopts'],'pumpio')))
+               if (!count($receiver) && ($b['private'] || !strstr($b['postopts'],'pumpio'))) {
                        return;
+               }
 
                // Dont't post if the post doesn't belong to us.
                // This is a check for forum postings
-               $self = dba::select('contact', array('id'), array('uid' => $b['uid'], 'self' => true), array('limit' => 1));
+               $self = dba::selectFirst('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
                if ($b['contact-id'] != $self['id']) {
                        return;
                }
@@ -1024,7 +1025,6 @@ function pumpio_get_contact($uid, $contact, $no_insert = false) {
 
                $contact_id = $r[0]['id'];
 
-                       require_once('include/group.php');
                Group::addMember(User::getDefaultGroup($uid), $contact_id);
        } else {
                $contact_id = $r[0]["id"];
@@ -1545,10 +1545,9 @@ function pumpio_getreceiver(&$a, $b) {
                        $gid = trim($gid, " <>");
 
                        $r = q("SELECT `contact`.`name`, `contact`.`nick`, `contact`.`url`, `contact`.`network` ".
-                               "FROM `group_member`, `contact` WHERE `group_member`.`gid` = %d AND `group_member`.`uid` = %d ".
+                               "FROM `group_member`, `contact` WHERE `group_member`.`gid` = %d ".
                                "AND `contact`.`id` = `group_member`.`contact-id` AND `contact`.`network` = '%s'",
                                        intval($gid),
-                                       intval($b["uid"]),
                                        dbesc(NETWORK_PUMPIO)
                                );