From 94244024aca2840913ba43992350505a3115c232 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 26 Dec 2017 01:05:00 +0100 Subject: [PATCH] Improve conditions in api_account_update_profile --- include/api.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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']]); -- 2.39.5