From: Hannes Mannerheim Date: Tue, 11 Aug 2015 20:18:57 +0000 (+0200) Subject: make it possible to erase fields in the profile via the api X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=76004660e9138b94668263769d4b10cfb1e77955;p=quix0rs-gnu-social.git make it possible to erase fields in the profile via the api --- diff --git a/actions/apiaccountupdateprofile.php b/actions/apiaccountupdateprofile.php index a9842ec5d8..1999248b93 100644 --- a/actions/apiaccountupdateprofile.php +++ b/actions/apiaccountupdateprofile.php @@ -98,15 +98,21 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction if (!empty($this->name)) { $profile->fullname = $this->name; + } else { + $profile->fullname = ''; } if (!empty($this->url)) { $profile->homepage = $this->url; - } + } else { + $profile->homepage = ''; + } if (!empty($this->description)) { $profile->bio = $this->description; - } + } else { + $profile->bio = ''; + } if (!empty($this->location)) { $profile->location = $this->location; @@ -119,7 +125,9 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction $profile->location_id = $loc->location_id; $profile->location_ns = $loc->location_ns; } - } + } else { + $profile->location = ''; + } $result = $profile->update($original);