Improve conditions in api_account_update_profile
This commit is contained in:
parent
de5dae0751
commit
94244024ac
1 changed files with 3 additions and 3 deletions
|
@ -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']]);
|
||||
|
|
Loading…
Reference in a new issue