summaryrefslogtreecommitdiff
path: root/actions/updateprofile.php
diff options
context:
space:
mode:
authorAdrian Lang <mail@adrianlang.de>2009-03-03 16:12:05 +0100
committerAdrian Lang <mail@adrianlang.de>2009-03-09 08:06:31 +0100
commitfbe794e44d235d2f66ef418796f87947631afb6a (patch)
tree0ce90398638bdb938ebab6b3b400a3aaece0cc90 /actions/updateprofile.php
parent6ab9d6b14016cf97fe1a31d89591e1a0e919c8a7 (diff)
Improve handling of null values in profile parameters.
This commit fixes two issues: - Allowing remote users to clear profile parameters via OMB. - Improved handling of profile parameters which evaluate to false ('0' for example)
Diffstat (limited to 'actions/updateprofile.php')
-rw-r--r--actions/updateprofile.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/actions/updateprofile.php b/actions/updateprofile.php
index 2268c432f..7dc52fda9 100644
--- a/actions/updateprofile.php
+++ b/actions/updateprofile.php
@@ -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;
}