diff --git a/phpBB/adm/admin_board.php b/phpBB/adm/admin_board.php index d575852f4e..b46564205c 100644 --- a/phpBB/adm/admin_board.php +++ b/phpBB/adm/admin_board.php @@ -22,7 +22,7 @@ if (!empty($setmodules)) $module['GENERAL']['SERVER_SETTINGS'] = ($auth->acl_get('a_server')) ? "$filename$SID&mode=server" : ''; $module['GENERAL']['AUTH_SETTINGS'] = ($auth->acl_get('a_server')) ? "$filename$SID&mode=auth" : ''; $module['GENERAL']['LOAD_SETTINGS'] = ($auth->acl_get('a_server')) ? "$filename$SID&mode=load" : ''; - $module['USER']['KARMA_SETTINGS'] = ($auth->acl_get('a_users')) ? "$filename$SID&mode=karma" : ''; + $module['USER']['KARMA_SETTINGS'] = ($auth->acl_get('a_user')) ? "$filename$SID&mode=karma" : ''; return; } @@ -73,7 +73,7 @@ switch ($mode) break; case 'karma': $l_title = 'KARMA_SETTINGS'; - $which_auth = 'a_users'; + $which_auth = 'a_user'; break; default: return; @@ -86,8 +86,8 @@ if (!$auth->acl_get($which_auth)) } // Pull all config data -$sql = "SELECT * - FROM " . CONFIG_TABLE; +$sql = 'SELECT * + FROM ' . CONFIG_TABLE; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) @@ -96,11 +96,11 @@ while ($row = $db->sql_fetchrow($result)) $config_value = $row['config_value']; $default_config[$config_name] = $config_value; - $new[$config_name] = (isset($_POST[$config_name])) ? $_POST[$config_name] : $default_config[$config_name]; + $new[$config_name] = request_var($config_name, $default_config[$config_name]); if ($submit) { - set_config($config_name, str_replace('\\\\', '\\', addslashes($new[$config_name]))); + set_config($config_name, $new[$config_name]); } } @@ -241,8 +241,7 @@ switch ($mode) $attachments_yes = ($new['allow_attachments']) ? 'checked="checked"' : ''; $attachments_no = (!$new['allow_attachments']) ? 'checked="checked"' : ''; - // Caching screws up slashes so we fudge a solution - $user_char_ary = array('USERNAME_CHARS_ANY' => '.*', 'USERNAME_ALPHA_ONLY' => '[/w]+', 'USERNAME_ALPHA_SPACERS' => '[/w_/+/. /-/[/]]+'); + $user_char_ary = array('USERNAME_CHARS_ANY' => '.*', 'USERNAME_ALPHA_ONLY' => '[/w]+', 'USERNAME_ALPHA_SPACERS' => '[\w_\+\. \-\[\]]+'); $user_char_options = ''; foreach ($user_char_ary as $lang => $value) { @@ -434,14 +433,6 @@ switch ($mode)