]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
make it possible to erase fields in the profile via the api
authorHannes Mannerheim <h@nnesmannerhe.im>
Tue, 11 Aug 2015 20:18:57 +0000 (22:18 +0200)
committerHannes Mannerheim <h@nnesmannerhe.im>
Tue, 11 Aug 2015 20:18:57 +0000 (22:18 +0200)
actions/apiaccountupdateprofile.php

index a9842ec5d8f33d80dba29e353e4597be3150623c..1999248b9304e96be83573d8b78100ae9f65e234 100644 (file)
@@ -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);