]> git.mxchange.org Git - friendica.git/commitdiff
Improve conditions in api_account_update_profile
authorPierre Rudloff <contact@rudloff.pro>
Tue, 26 Dec 2017 00:05:00 +0000 (01:05 +0100)
committerPierre Rudloff <contact@rudloff.pro>
Tue, 26 Dec 2017 00:05:12 +0000 (01:05 +0100)
include/api.php

index 46b7cd3dea06924aa7feb9da210c98afb65b913c..59317fcd319bfc9df99b78d37a56ba6ecdd07095 100644 (file)
@@ -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']]);