From: Pierre Rudloff Date: Tue, 26 Dec 2017 00:05:00 +0000 (+0100) Subject: Improve conditions in api_account_update_profile X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=94244024aca2840913ba43992350505a3115c232;p=friendica.git Improve conditions in api_account_update_profile --- diff --git a/include/api.php b/include/api.php index 46b7cd3dea..59317fcd31 100644 --- a/include/api.php +++ b/include/api.php @@ -4481,17 +4481,17 @@ api_register_func('api/account/update_profile_image', 'api_account_update_profil */ function api_account_update_profile($type) { - $local_user = local_user(); + $local_user = api_user(); $api_user = api_get_user(get_app()); - if (x($_POST['name'])) { + if (!empty($_POST['name'])) { dba::update('profile', ['name' => $_POST['name']], ['uid' => $local_user]); dba::update('user', ['username' => $_POST['name']], ['uid' => $local_user]); dba::update('contact', ['name' => $_POST['name']], ['uid' => $local_user, 'self' => 1]); dba::update('contact', ['name' => $_POST['name']], ['id' => $api_user['id']]); } - if (x($_POST['description'])) { + if (isset($_POST['description'])) { dba::update('profile', ['about' => $_POST['description']], ['uid' => $local_user]); dba::update('contact', ['about' => $_POST['description']], ['uid' => $local_user, 'self' => 1]); dba::update('contact', ['about' => $_POST['description']], ['id' => $api_user['id']]);