diff options
author | javiexin <javiexin@gmail.com> | 2015-06-23 11:02:08 +0200 |
---|---|---|
committer | javiexin <javiexin@gmail.com> | 2015-06-23 11:02:08 +0200 |
commit | bd40f2f6198bc092ba20b2ec79648c425cec6c2e (patch) | |
tree | f8fbabc1b2509cabd9276f58f3d68eb12bc4c5a9 | |
parent | 558d604d83fd5ded2edc854a9944ad0d1188e2e5 (diff) | |
download | forums-bd40f2f6198bc092ba20b2ec79648c425cec6c2e.tar forums-bd40f2f6198bc092ba20b2ec79648c425cec6c2e.tar.gz forums-bd40f2f6198bc092ba20b2ec79648c425cec6c2e.tar.bz2 forums-bd40f2f6198bc092ba20b2ec79648c425cec6c2e.tar.xz forums-bd40f2f6198bc092ba20b2ec79648c425cec6c2e.zip |
[ticket/13960] Profile field validation breaks ACP
Make sure new step is calculated only if no error has been identified
during validation. Also, cleanup redundant code in acp_profile.php.
PHPBB3-13960
-rw-r--r-- | phpBB/includes/acp/acp_profile.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 97c1f62077..d82320e5e8 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -511,13 +511,14 @@ class acp_profile } } - $step = (isset($_REQUEST['next'])) ? $step + 1 : ((isset($_REQUEST['prev'])) ? $step - 1 : $step); - if (sizeof($error)) { - $step--; $submit = false; } + else + { + $step = (isset($_REQUEST['next'])) ? $step + 1 : ((isset($_REQUEST['prev'])) ? $step - 1 : $step); + } // Build up the specific hidden fields foreach ($exclude as $num => $key_ary) @@ -535,7 +536,7 @@ class acp_profile $var = $profile_field->prepare_hidden_fields($step, $key, $action, $field_data); if ($var !== null) { - $_new_key_ary[$key] = $profile_field->prepare_hidden_fields($step, $key, $action, $field_data); + $_new_key_ary[$key] = $var; } } $cp->vars = $field_data; @@ -545,11 +546,7 @@ class acp_profile if (!sizeof($error)) { - if ($step == 3 && (sizeof($this->lang_defs['iso']) == 1 || $save)) - { - $this->save_profile_field($cp, $field_type, $action); - } - else if ($action == 'edit' && $save) + if (($step == 3 && (sizeof($this->lang_defs['iso']) == 1 || $save)) || ($action == 'edit' && $save)) { $this->save_profile_field($cp, $field_type, $action); } |