aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrxu <rxu@mail.ru>2012-02-05 22:03:02 +0800
committerrxu <rxu@mail.ru>2012-02-05 22:03:02 +0800
commitf832f5a4ee88459dae6fda7e1b303b15f84768dc (patch)
treecc0231bebcab70008d0080840fdbae08c526a2c7
parent99164cd20b9d8ca77b1e9a54e0958cdb580945d0 (diff)
downloadforums-f832f5a4ee88459dae6fda7e1b303b15f84768dc.tar
forums-f832f5a4ee88459dae6fda7e1b303b15f84768dc.tar.gz
forums-f832f5a4ee88459dae6fda7e1b303b15f84768dc.tar.bz2
forums-f832f5a4ee88459dae6fda7e1b303b15f84768dc.tar.xz
forums-f832f5a4ee88459dae6fda7e1b303b15f84768dc.zip
[ticket/9831] Fix saving unchecked checkbox field value
PHPBB3-9831
-rw-r--r--phpBB/includes/acp/acp_profile.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 09a7a2f9ed..a591474fce 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -511,6 +511,14 @@ class acp_profile
// If we switch the type on step 2, we have to adjust field value.
// 1 is a common value for the checkbox and radio buttons.
+ // Adjust unchecked checkbox value.
+ // If we return or save settings from 2nd/3rd page
+ // and the checkbox is unchecked, set the value to 0.
+ if (isset($_REQUEST['step']) && !isset($_REQUEST[$key]))
+ {
+ $var = 0;
+ }
+
// If we switch to the checkbox type but former radio buttons value was 2,
// which is not the case for the checkbox, set it to 0 (unchecked).
if ($cp->vars['field_length'] == 2 && $var == 2)