Merge pull request #7853 from annando/warnings

Fix some notices/warnings again
This commit is contained in:
Hypolite Petovan 2019-11-21 18:11:10 -05:00 committed by GitHub
commit 27827d42ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View file

@ -959,7 +959,7 @@ function api_account_verify_credentials($type)
// - Adding last status
if (!$skip_status) {
$item = api_get_last_status($user_info['pid'], $user_info['uid']);
if ($item) {
if (!empty($item)) {
$user_info['status'] = api_format_item($item, $type);
}
}
@ -1318,7 +1318,7 @@ function api_status_show($type, $item_id)
$status_info = [];
$item = api_get_item(['id' => $item_id]);
if ($item) {
if (!empty($item)) {
$status_info = api_format_item($item, $type);
}
@ -1382,7 +1382,7 @@ function api_users_show($type)
$user_info = api_get_user($a);
$item = api_get_last_status($user_info['pid'], $user_info['uid']);
if ($item) {
if (!empty($item)) {
$user_info['status'] = api_format_item($item, $type);
}

View file

@ -3447,10 +3447,10 @@ class Diaspora
$ret = [];
if ($profile != "") {
if (Contact::getIdForURL($profile)) {
$author = Contact::getDetailsByURL($profile);
$ret["root_handle"] = $author['addr'];
if (!empty($profile) && ($cid = Contact::getIdForURL($profile))) {
$contact = DBA::selectFirst('contact', ['addr'], ['id' => $cid]);
if (!empty($contact['addr'])) {
$ret['root_handle'] = $contact['addr'];
}
}