diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-17 17:32:46 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-17 17:32:46 +0000 |
| commit | 545bf57cb32920365e98b64ba7b99d51cbd01017 (patch) | |
| tree | f1f2fd392f47005612da9a4c915aed454edc5aaf /phpBB/includes/acp | |
| parent | 760d0a66d4591d8e6fc7660a820742afb1073863 (diff) | |
| download | forums-545bf57cb32920365e98b64ba7b99d51cbd01017.tar forums-545bf57cb32920365e98b64ba7b99d51cbd01017.tar.gz forums-545bf57cb32920365e98b64ba7b99d51cbd01017.tar.bz2 forums-545bf57cb32920365e98b64ba7b99d51cbd01017.tar.xz forums-545bf57cb32920365e98b64ba7b99d51cbd01017.zip | |
#1843
git-svn-id: file:///svn/phpbb/trunk@5923 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp')
| -rw-r--r-- | phpBB/includes/acp/acp_profile.php | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 16b51f681d..4c7a268f09 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -318,23 +318,31 @@ class acp_profile $cp->vars['lang_explain'] = request_var('lang_explain', $field_row['lang_explain'], true); $cp->vars['lang_default_value'] = request_var('lang_default_value', $field_row['lang_default_value'], true); - $options = request_var('lang_options', '', true); + // A boolean field expects an array as the lang options + if ($field_type == FIELD_BOOL) + { + $options = request_var('lang_options', array(''), true); + } + else + { + $options = request_var('lang_options', '', true); + } // If the user has submitted a form with options (i.e. dropdown field) if ($options) { - $exploded_options = explode("\n", $options); + $exploded_options = (is_array($options)) ? $options : explode("\n", $options); if (sizeof($exploded_options) == sizeof($lang_options) || $action == 'create') { // The number of options in the field is equal to the number of options already in the database // Or we are creating a new dropdown list. - $cp->vars['lang_options'] = explode("\n", $options); + $cp->vars['lang_options'] = $exploded_options; } else if ($action == 'edit') { // Changing the number of options? (We remove and re-create the option fields) - $cp->vars['lang_options'] = explode("\n", $options); + $cp->vars['lang_options'] = $exploded_options; } } else @@ -526,11 +534,13 @@ class acp_profile foreach ($key_ary as $key) { - $var = isset($_REQUEST[$key]) ? request_var($key, '', true) : false; - - if ($var !== false) + if (!isset($_REQUEST[$key])) + { + $var = false; + } + else { - $_new_key_ary[$key] = $var; + $_new_key_ary[$key] = (is_array($_REQUEST[$key])) ? request_var($key, array(''), true) : request_var($key, '', true); } } |
