aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_profile_fields.php
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-03-09 05:24:03 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2012-03-09 05:24:03 -0500
commitbd1fb91dd2245c0b84d5857b3633ea4ad65545db (patch)
tree1109e56aef5c1db6d6d4b9d30c55eaf539e55bb7 /phpBB/includes/functions_profile_fields.php
parent0ec8e9dbff7d71e9a60ec8de8a15ba8f28ccdc04 (diff)
parentf832f5a4ee88459dae6fda7e1b303b15f84768dc (diff)
downloadforums-bd1fb91dd2245c0b84d5857b3633ea4ad65545db.tar
forums-bd1fb91dd2245c0b84d5857b3633ea4ad65545db.tar.gz
forums-bd1fb91dd2245c0b84d5857b3633ea4ad65545db.tar.bz2
forums-bd1fb91dd2245c0b84d5857b3633ea4ad65545db.tar.xz
forums-bd1fb91dd2245c0b84d5857b3633ea4ad65545db.zip
Merge remote-tracking branch 'rxu/ticket/9831' into develop-olympus
* rxu/ticket/9831: [ticket/9831] Fix saving unchecked checkbox field value [ticket/9831] Correctly store checkbox default value for boolean CPF.
Diffstat (limited to 'phpBB/includes/functions_profile_fields.php')
-rw-r--r--phpBB/includes/functions_profile_fields.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php
index d44be16184..16c193c15a 100644
--- a/phpBB/includes/functions_profile_fields.php
+++ b/phpBB/includes/functions_profile_fields.php
@@ -630,10 +630,10 @@ class custom_profile
$profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
$user_ident = $profile_row['field_ident'];
- // checkbox - only testing for isset
+ // checkbox - set the value to "true" if it has been set to 1
if ($profile_row['field_type'] == FIELD_BOOL && $profile_row['field_length'] == 2)
{
- $value = (isset($_REQUEST[$profile_row['field_ident']])) ? true : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);
+ $value = (isset($_REQUEST[$profile_row['field_ident']]) && request_var($profile_row['field_ident'], $default_value) == 1) ? true : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);
}
else if ($profile_row['field_type'] == FIELD_INT)
{