X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapiaccountupdateprofile.php;h=8767dabf8528a6ef23c597bb7b4a8de47903ba8a;hb=792b62874e13214dc12480acd2cf4a40b3292d79;hp=1999248b9304e96be83573d8b78100ae9f65e234;hpb=76004660e9138b94668263769d4b10cfb1e77955;p=quix0rs-gnu-social.git diff --git a/actions/apiaccountupdateprofile.php b/actions/apiaccountupdateprofile.php index 1999248b93..8767dabf85 100644 --- a/actions/apiaccountupdateprofile.php +++ b/actions/apiaccountupdateprofile.php @@ -96,27 +96,12 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction $original = clone($profile); - 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 = ''; - } + $profile->fullname = $this->name; + $profile->homepage = $this->url; + $profile->bio = $this->description; + $profile->location = $this->location; if (!empty($this->location)) { - $profile->location = $this->location; - $loc = Location::fromName($this->location); if (!empty($loc)) { @@ -126,8 +111,12 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction $profile->location_ns = $loc->location_ns; } } else { - $profile->location = ''; - } + // location is empty so reset the extrapolated information too + $profile->lat = ''; + $profile->lon = ''; + $profile->location_id = ''; + $profile->location_ns = ''; + } $result = $profile->update($original);