forked from friendica/friendica-addons
Replace dba::select(limit => 1) by dba::selectOne()
This commit is contained in:
parent
4b05d70b94
commit
ca6e477701
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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"');
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue