]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/updateprofile.php
change Controlez-Vous to Control Yourself
[quix0rs-gnu-social.git] / actions / updateprofile.php
index 2268c432f17dd4cea52f00a77cb500a28e9cc745..7db80bf06722103f22d1bc9438a49f0dfe84594b 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, Control Yourself, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -29,7 +29,7 @@ class UpdateprofileAction extends Action
         parent::handle($args);
         try {
             common_remove_magic_from_request();
-            $req = OAuthRequest::from_request();
+            $req = OAuthRequest::from_request('POST', common_local_url('updateprofile'));
             # Note: server-to-server function!
             $server = omb_oauth_server();
             list($consumer, $token) = $server->verify_request($req);
@@ -138,22 +138,24 @@ class UpdateprofileAction extends Action
 
         $orig_profile = clone($profile);
 
-        if ($nickname) {
+        /* Use values even if they are an empty string. Parsing an empty string in
+           updateProfile is the specified way of clearing a parameter in OMB. */
+        if (!is_null($nickname)) {
             $profile->nickname = $nickname;
         }
-        if ($profile_url) {
+        if (!is_null($profile_url)) {
             $profile->profileurl = $profile_url;
         }
-        if ($fullname) {
+        if (!is_null($fullname)) {
             $profile->fullname = $fullname;
         }
-        if ($homepage) {
+        if (!is_null($homepage)) {
             $profile->homepage = $homepage;
         }
-        if ($bio) {
+        if (!is_null($bio)) {
             $profile->bio = $bio;
         }
-        if ($location) {
+        if (!is_null($location)) {
             $profile->location = $location;
         }