Replace dba::select(limit => 1) by dba::selectOne()

pull/486/head
Hypolite Petovan 2018-01-09 22:27:30 -05:00
parent 4b05d70b94
commit ca6e477701
10 changed files with 10 additions and 10 deletions

View File

@ -250,7 +250,7 @@ function buffer_send(App $a, &$b)
// Dont't post if the post doesn't belong to us. // Dont't post if the post doesn't belong to us.
// This is a check for forum postings // 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']) { if ($b['contact-id'] != $self['id']) {
return; return;
} }

View File

@ -286,7 +286,7 @@ function diaspora_send(&$a,&$b) {
// Dont't post if the post doesn't belong to us. // Dont't post if the post doesn't belong to us.
// This is a check for forum postings // 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']) { if ($b['contact-id'] != $self['id']) {
return; return;
} }

View 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)) { if (!DBM::is_result($user)) {
logger('User ' . $nickname . ' not found.', LOGGER_DEBUG); logger('User ' . $nickname . ' not found.', LOGGER_DEBUG);
return; return;

View File

@ -166,7 +166,7 @@ function libertree_send(&$a,&$b) {
// Dont't post if the post doesn't belong to us. // Dont't post if the post doesn't belong to us.
// This is a check for forum postings // 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']) { if ($b['contact-id'] != $self['id']) {
return; return;
} }

View File

@ -418,7 +418,7 @@ function pumpio_send(&$a,&$b) {
// Dont't post if the post doesn't belong to us. // Dont't post if the post doesn't belong to us.
// This is a check for forum postings // 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']) { if ($b['contact-id'] != $self['id']) {
return; return;
} }

View File

@ -580,7 +580,7 @@ function statusnet_post_hook(App $a, &$b)
// Dont't post if the post doesn't belong to us. // Dont't post if the post doesn't belong to us.
// This is a check for forum postings // 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']) { if ($b['contact-id'] != $self['id']) {
return; return;
} }

View File

@ -327,7 +327,7 @@ function tumblr_send(&$a,&$b) {
// Dont't post if the post doesn't belong to us. // Dont't post if the post doesn't belong to us.
// This is a check for forum postings // 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']) { if ($b['contact-id'] != $self['id']) {
return; return;
} }

View File

@ -468,7 +468,7 @@ function twitter_post_hook(App $a, &$b)
// Dont't post if the post doesn't belong to us. // Dont't post if the post doesn't belong to us.
// This is a check for forum postings // 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']) { if ($b['contact-id'] != $self['id']) {
return; return;
} }

View File

@ -458,7 +458,7 @@ function windowsphonepush_login(App $a)
$user_id = User::authenticate($_SERVER['PHP_AUTH_USER'], trim($_SERVER['PHP_AUTH_PW'])); $user_id = User::authenticate($_SERVER['PHP_AUTH_USER'], trim($_SERVER['PHP_AUTH_PW']));
if ($user_id) { if ($user_id) {
$record = dba::select('user', [], ['uid' => $user_id], ['limit' => 1]); $record = dba::selectOne('user', [], ['uid' => $user_id]);
} else { } else {
logger('API_login failure: ' . print_r($_SERVER, true), LOGGER_DEBUG); logger('API_login failure: ' . print_r($_SERVER, true), LOGGER_DEBUG);
header('WWW-Authenticate: Basic realm="Friendica"'); header('WWW-Authenticate: Basic realm="Friendica"');

View File

@ -202,7 +202,7 @@ function wppost_send(&$a,&$b) {
// Dont't post if the post doesn't belong to us. // Dont't post if the post doesn't belong to us.
// This is a check for forum postings // 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']) { if ($b['contact-id'] != $self['id']) {
return; return;
} }