mirror of
https://github.com/friendica/friendica
synced 2025-04-27 13:10:10 +00:00
Improve dba::selectFirst calls
- Fix remaining $r[0] references - Rename $r to meaningful names
This commit is contained in:
parent
465e1d6a5c
commit
5fc4927764
29 changed files with 228 additions and 250 deletions
|
@ -63,11 +63,10 @@ class FKOAuth1 extends OAuthServer
|
|||
$a->timezone = $a->user['timezone'];
|
||||
}
|
||||
|
||||
$r = dba::selectFirst('contact', [], ['uid' => $_SESSION['uid'], 'self' => 1]);
|
||||
|
||||
if (DBM::is_result($r)) {
|
||||
$a->contact = $r;
|
||||
$a->cid = $r['id'];
|
||||
$contact = dba::selectFirst('contact', [], ['uid' => $_SESSION['uid'], 'self' => 1]);
|
||||
if (DBM::is_result($contact)) {
|
||||
$a->contact = $contact;
|
||||
$a->cid = $contact['id'];
|
||||
$_SESSION['cid'] = $a->cid;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,10 +88,9 @@ class FKOAuthDataStore extends OAuthDataStore
|
|||
*/
|
||||
public function lookup_nonce($consumer, $token, $nonce, $timestamp)
|
||||
{
|
||||
$r = dba::selectFirst('tokens', ['id', 'secret'], ['client_id' => $consumer->key, 'id' => $nonce, 'expires' => $timestamp]);
|
||||
|
||||
if (DBM::is_result($r)) {
|
||||
return new \OAuthToken($r['id'], $r['secret']);
|
||||
$token = dba::selectFirst('tokens', ['id', 'secret'], ['client_id' => $consumer->key, 'id' => $nonce, 'expires' => $timestamp]);
|
||||
if (DBM::is_result($token)) {
|
||||
return new \OAuthToken($token['id'], $token['secret']);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue