]> git.mxchange.org Git - friendica-addons.git/commitdiff
Replace dba::select(limit => 1) by dba::selectOne()
authorHypolite Petovan <mrpetovan@gmail.com>
Wed, 10 Jan 2018 03:27:30 +0000 (22:27 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Wed, 10 Jan 2018 03:27:30 +0000 (22:27 -0500)
buffer/buffer.php
diaspora/diaspora.php
ifttt/ifttt.php
libertree/libertree.php
pumpio/pumpio.php
statusnet/statusnet.php
tumblr/tumblr.php
twitter/twitter.php
windowsphonepush/windowsphonepush.php
wppost/wppost.php

index 97373f301488487ad4a5f753d1bb5ef18eb31a83..6ecfb1894a4241b204d157e54d97cca1a271b60f 100644 (file)
@@ -250,7 +250,7 @@ function buffer_send(App $a, &$b)
 
        // Dont't post if the post doesn't belong to us.
        // This is a check for forum postings
 
        // 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::selectOne('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
        if ($b['contact-id'] != $self['id']) {
                return;
        }
        if ($b['contact-id'] != $self['id']) {
                return;
        }
index 04ed24ca84b42d12d5f3dfed190a3e3fecaacdf3..d2e2961dc2c7a428eed7f12c165e9640a5df2d61 100644 (file)
@@ -286,7 +286,7 @@ function diaspora_send(&$a,&$b) {
 
        // Dont't post if the post doesn't belong to us.
        // This is a check for forum postings
 
        // 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::selectOne('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
        if ($b['contact-id'] != $self['id']) {
                return;
        }
        if ($b['contact-id'] != $self['id']) {
                return;
        }
index 384b955c0b182c7350671a63203fd867d8f660d6..ad7a367b80789168b06b1fb011630fec6bede601 100644 (file)
@@ -97,7 +97,7 @@ function ifttt_post(App $a)
 
        $nickname = $a->argv[1];
 
 
        $nickname = $a->argv[1];
 
-       $user = dba::select('user', ['uid'], ['nickname' => $nickname], ['limit' => 1]);
+       $user = dba::selectOne('user', ['uid'], ['nickname' => $nickname]);
        if (!DBM::is_result($user)) {
                logger('User ' . $nickname . ' not found.', LOGGER_DEBUG);
                return;
        if (!DBM::is_result($user)) {
                logger('User ' . $nickname . ' not found.', LOGGER_DEBUG);
                return;
index 95def07a0b01dfd5dd0119bc74cf0e5f671f7ebf..f942bed3f4583f3277e67a2522c695278e65ad04 100644 (file)
@@ -166,7 +166,7 @@ function libertree_send(&$a,&$b) {
 
        // Dont't post if the post doesn't belong to us.
        // This is a check for forum postings
 
        // 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::selectOne('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
        if ($b['contact-id'] != $self['id']) {
                return;
        }
        if ($b['contact-id'] != $self['id']) {
                return;
        }
index f5bf6496a01321992741988dccb2da64fdf8ac7f..52a48ae2051d3a1afad70f057b4eda176a31ce1e 100644 (file)
@@ -418,7 +418,7 @@ function pumpio_send(&$a,&$b) {
 
                // Dont't post if the post doesn't belong to us.
                // This is a check for forum postings
 
                // 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::selectOne('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
                if ($b['contact-id'] != $self['id']) {
                        return;
                }
                if ($b['contact-id'] != $self['id']) {
                        return;
                }
index 659ddaef2a59a13840a6022bd9dcaac0cdb3fadb..814722f45e4257300974a208a297fde1e9812139 100644 (file)
@@ -580,7 +580,7 @@ function statusnet_post_hook(App $a, &$b)
 
                // Dont't post if the post doesn't belong to us.
                // This is a check for forum postings
 
                // 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::selectOne('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
                if ($b['contact-id'] != $self['id']) {
                        return;
                }
                if ($b['contact-id'] != $self['id']) {
                        return;
                }
index 77d98aca704493fa05dbf5ba28627f018a2c0866..674093edf7f02ca47e9596f010cf7a51dc09aba9 100644 (file)
@@ -327,7 +327,7 @@ function tumblr_send(&$a,&$b) {
 
        // Dont't post if the post doesn't belong to us.
        // This is a check for forum postings
 
        // 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::selectOne('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
        if ($b['contact-id'] != $self['id']) {
                return;
        }
        if ($b['contact-id'] != $self['id']) {
                return;
        }
index 43aee0fef502193b2734e97bda444966a714dba1..e501a3442882085c3b6c15b052474874266bbc74 100644 (file)
@@ -468,7 +468,7 @@ function twitter_post_hook(App $a, &$b)
 
                // Dont't post if the post doesn't belong to us.
                // This is a check for forum postings
 
                // 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::selectOne('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
                if ($b['contact-id'] != $self['id']) {
                        return;
                }
                if ($b['contact-id'] != $self['id']) {
                        return;
                }
index baa4c656e3beace9c1b015cfb223fd70edd4ea69..c9d58bd7f353106ff085ad830f08f4a214359d51 100644 (file)
@@ -458,7 +458,7 @@ function windowsphonepush_login(App $a)
        $user_id = User::authenticate($_SERVER['PHP_AUTH_USER'], trim($_SERVER['PHP_AUTH_PW']));
 
        if ($user_id) {
        $user_id = User::authenticate($_SERVER['PHP_AUTH_USER'], trim($_SERVER['PHP_AUTH_PW']));
 
        if ($user_id) {
-               $record = dba::select('user', [], ['uid' => $user_id], ['limit' => 1]);
+               $record = dba::selectOne('user', [], ['uid' => $user_id]);
        } else {
                logger('API_login failure: ' . print_r($_SERVER, true), LOGGER_DEBUG);
                header('WWW-Authenticate: Basic realm="Friendica"');
        } else {
                logger('API_login failure: ' . print_r($_SERVER, true), LOGGER_DEBUG);
                header('WWW-Authenticate: Basic realm="Friendica"');
index ea26ae45340a7070de9e0d4fdb0bf772fecd96fb..d6daa8c065a8318cf9279135be30930463427897 100644 (file)
@@ -202,7 +202,7 @@ function wppost_send(&$a,&$b) {
 
        // Dont't post if the post doesn't belong to us.
        // This is a check for forum postings
 
        // 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::selectOne('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
        if ($b['contact-id'] != $self['id']) {
                return;
        }
        if ($b['contact-id'] != $self['id']) {
                return;
        }