mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 13:30:25 +02:00
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.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user