Merge pull request #6789 from nupplaphil/issue/6337-warnings

Check if user_info is an array before counting
This commit is contained in:
Hypolite Petovan 2019-03-02 08:33:20 -05:00 committed by GitHub
commit b01efc3ada
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -953,10 +953,12 @@ function api_account_verify_credentials($type)
// - Adding last status // - Adding last status
if (!$skip_status) { if (!$skip_status) {
$user_info["status"] = api_status_show("raw"); $user_info["status"] = api_status_show("raw");
if (!count($user_info["status"])) { if (isset($user_info["status"])) {
unset($user_info["status"]); if (!is_array($user_info["status"]) || !count($user_info["status"])) {
} else { unset($user_info["status"]);
unset($user_info["status"]["user"]); } else {
unset($user_info["status"]["user"]);
}
} }
} }