summaryrefslogtreecommitdiff
path: root/actions/updateprofile.php
diff options
context:
space:
mode:
authorFederico Marani <federico.marani@ymail.com>2009-03-16 22:43:51 +0000
committerFederico Marani <federico.marani@ymail.com>2009-03-16 22:43:51 +0000
commit420c3613049bec1360cdeb1f50283b239adf23d3 (patch)
tree0ab458b3c45c883232b3ed31addbc2aba1288f6a /actions/updateprofile.php
parentbab3e1b8586f42bc1f0a5f96b6990d67c6b74446 (diff)
parentb3a0eea3b66e95becb6c4595ed71c7fe71ed6437 (diff)
Merge branch '0.8.x' of git://gitorious.org/laconica/dev into 0.8.x
Diffstat (limited to 'actions/updateprofile.php')
-rw-r--r--actions/updateprofile.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/actions/updateprofile.php b/actions/updateprofile.php
index 4751a04ff..7dc52fda9 100644
--- a/actions/updateprofile.php
+++ b/actions/updateprofile.php
@@ -34,6 +34,8 @@ class UpdateprofileAction extends Action
$server = omb_oauth_server();
list($consumer, $token) = $server->verify_request($req);
if ($this->update_profile($req, $consumer, $token)) {
+ header('HTTP/1.1 200 OK');
+ header('Content-type: text/plain');
print "omb_version=".OMB_VERSION_01;
}
} catch (OAuthException $e) {
@@ -136,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;
}
@@ -173,10 +177,6 @@ class UpdateprofileAction extends Action
return false;
}
}
- header('HTTP/1.1 200 OK');
- header('Content-type: text/plain');
- print 'Updated profile';
- print "\n";
return true;
}
}