diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-03-09 05:55:56 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-03-09 05:55:56 -0500 |
commit | c001bb9c0350c0886d2a78243331dd86624ed7c7 (patch) | |
tree | f358bfad0006e6f29bdc8e399546e566e7721302 /phpBB/includes/functions_profile_fields.php | |
parent | 5c4788a24c0d776831bc1ebd206ae6ff8ffd2ce9 (diff) | |
parent | bd1fb91dd2245c0b84d5857b3633ea4ad65545db (diff) | |
download | forums-c001bb9c0350c0886d2a78243331dd86624ed7c7.tar forums-c001bb9c0350c0886d2a78243331dd86624ed7c7.tar.gz forums-c001bb9c0350c0886d2a78243331dd86624ed7c7.tar.bz2 forums-c001bb9c0350c0886d2a78243331dd86624ed7c7.tar.xz forums-c001bb9c0350c0886d2a78243331dd86624ed7c7.zip |
Merge branch 'develop-olympus' into develop
* develop-olympus:
[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.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 334e7e6adc..34d973b3a6 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) { |