From 76004660e9138b94668263769d4b10cfb1e77955 Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Tue, 11 Aug 2015 22:18:57 +0200 Subject: [PATCH] make it possible to erase fields in the profile via the api --- actions/apiaccountupdateprofile.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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); -- 2.39.5