]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apiaccountupdateprofile.php
rudementary photo albums. going to /username/photos displays all the images username...
[quix0rs-gnu-social.git] / actions / apiaccountupdateprofile.php
index 8af0fb8660112b0fb53aa8429afe0e72ed88d23d..9b371ea95764e1f829e7c9bce1eba8cffcb3859a 100644 (file)
@@ -92,6 +92,15 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction
             return;
         }
 
+        if (!in_array($this->format, array('xml', 'json'))) {
+            $this->clientError(
+                _('API method not found.'),
+                404,
+                $this->format
+            );
+            return;
+        }
+
         if (empty($this->user)) {
             $this->clientError(_('No such user.'), 404, $this->format);
             return;
@@ -106,11 +115,11 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction
 
         $original = clone($profile);
 
-        if (empty($this->name)) {
+        if (!empty($this->name)) {
             $profile->fullname = $this->name;
         }
 
-        if (empty($this->url)) {
+        if (!empty($this->url)) {
             $profile->homepage = $this->url;
         }
 
@@ -135,7 +144,7 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction
 
         if (!$result) {
             common_log_db_error($profile, 'UPDATE', __FILE__);
-            $this->serverError(_('Couldn\'t save profile.'));
+            $this->serverError(_('Could not save profile.'));
             return;
         }