diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-07-22 20:11:45 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-07-22 20:11:45 +0000 |
commit | ec1da5b1fd694b4f1abcf4fa8009095d23b2c1a6 (patch) | |
tree | c6a4f679afd375f000d5b64485c7e14737fc941b /phpBB/includes | |
parent | fcb0c89962242fec72d7ed01c7049601a696e4be (diff) | |
download | forums-ec1da5b1fd694b4f1abcf4fa8009095d23b2c1a6.tar forums-ec1da5b1fd694b4f1abcf4fa8009095d23b2c1a6.tar.gz forums-ec1da5b1fd694b4f1abcf4fa8009095d23b2c1a6.tar.bz2 forums-ec1da5b1fd694b4f1abcf4fa8009095d23b2c1a6.tar.xz forums-ec1da5b1fd694b4f1abcf4fa8009095d23b2c1a6.zip |
try to normalize everything...
git-svn-id: file:///svn/phpbb/trunk@7920 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
25 files changed, 112 insertions, 81 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index a0aaf8d67e..95a2b0e322 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -441,7 +441,7 @@ class acp_attachments $ext_row = array(); } - $group_name = request_var('group_name', '', true); + $group_name = utf8_normalize_nfc(request_var('group_name', '', true)); $new_group_name = ($action == 'add') ? $group_name : (($ext_row['group_name'] != $group_name) ? $group_name : ''); if (!$group_name) @@ -618,7 +618,7 @@ class acp_attachments if ($action == 'add') { $ext_group_row = array( - 'group_name' => request_var('group_name', '', true), + 'group_name' => utf8_normalize_nfc(request_var('group_name', '', true)), 'cat_id' => 0, 'allow_group' => 1, 'allow_in_pm' => 1, diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php index ea0a054d5f..206f332c36 100644 --- a/phpBB/includes/acp/acp_ban.php +++ b/phpBB/includes/acp/acp_ban.php @@ -33,12 +33,12 @@ class acp_ban if ($bansubmit) { // Grab the list of entries - $ban = request_var('ban', '', true); + $ban = utf8_normalize_nfc(request_var('ban', '', true)); $ban_len = request_var('banlength', 0); $ban_len_other = request_var('banlengthother', ''); $ban_exclude = request_var('banexclude', 0); - $ban_reason = request_var('banreason', '', true); - $ban_give_reason = request_var('bangivereason', '', true); + $ban_reason = utf8_normalize_nfc(request_var('banreason', '', true)); + $ban_give_reason = utf8_normalize_nfc(request_var('bangivereason', '', true)); if ($ban) { diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 65c1f9026d..ce0d12b356 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -75,8 +75,8 @@ class acp_bbcodes $display_on_posting = request_var('display_on_posting', 0); $bbcode_match = request_var('bbcode_match', ''); - $bbcode_tpl = htmlspecialchars_decode(request_var('bbcode_tpl', '', true)); - $bbcode_helpline = request_var('bbcode_helpline', '', true); + $bbcode_tpl = htmlspecialchars_decode(utf8_normalize_nfc(request_var('bbcode_tpl', '', true))); + $bbcode_helpline = utf8_normalize_nfc(request_var('bbcode_helpline', '', true)); break; } diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php index 5bab27d5b2..dbee5f6eed 100644 --- a/phpBB/includes/acp/acp_bots.php +++ b/phpBB/includes/acp/acp_bots.php @@ -129,7 +129,7 @@ class acp_bots include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); $bot_row = array( - 'bot_name' => request_var('bot_name', '', true), + 'bot_name' => utf8_normalize_nfc(request_var('bot_name', '', true)), 'bot_agent' => request_var('bot_agent', ''), 'bot_ip' => request_var('bot_ip', ''), 'bot_active' => request_var('bot_active', true), diff --git a/phpBB/includes/acp/acp_disallow.php b/phpBB/includes/acp/acp_disallow.php index c574c8e803..4be61ad778 100644 --- a/phpBB/includes/acp/acp_disallow.php +++ b/phpBB/includes/acp/acp_disallow.php @@ -33,7 +33,7 @@ class acp_disallow if ($disallow) { - $disallowed_user = str_replace('*', '%', request_var('disallowed_user', '', true)); + $disallowed_user = str_replace('*', '%', utf8_normalize_nfc(request_var('disallowed_user', '', true))); if (!$disallowed_user) { diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index 3fbbe6472f..50f3d2a4c8 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -30,8 +30,8 @@ class acp_email $usernames = request_var('usernames', '', true); $group_id = request_var('g', 0); - $subject = request_var('subject', '', true); - $message = request_var('message', '', true); + $subject = utf8_normalize_nfc(request_var('subject', '', true)); + $message = utf8_normalize_nfc(request_var('message', '', true)); // Do the job ... if ($submit) @@ -178,7 +178,7 @@ class acp_email if ($usernames) { $usernames = explode("\n", $usernames); - add_log('admin', 'LOG_MASS_EMAIL', implode(', ', $usernames)); + add_log('admin', 'LOG_MASS_EMAIL', implode(', ', utf8_normalize_nfc($usernames))); } else { diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 2fae905b5f..fd2602d329 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -103,14 +103,14 @@ class acp_forums 'type_action' => request_var('type_action', ''), 'forum_status' => request_var('forum_status', ITEM_UNLOCKED), 'forum_parents' => '', - 'forum_name' => request_var('forum_name', '', true), + 'forum_name' => utf8_normalize_nfc(request_var('forum_name', '', true)), 'forum_link' => request_var('forum_link', ''), 'forum_link_track' => request_var('forum_link_track', false), - 'forum_desc' => request_var('forum_desc', '', true), + 'forum_desc' => utf8_normalize_nfc(request_var('forum_desc', '', true)), 'forum_desc_uid' => '', 'forum_desc_options' => 7, 'forum_desc_bitfield' => '', - 'forum_rules' => request_var('forum_rules', '', true), + 'forum_rules' => utf8_normalize_nfc(request_var('forum_rules', '', true)), 'forum_rules_uid' => '', 'forum_rules_options' => 7, 'forum_rules_bitfield' => '', @@ -445,7 +445,7 @@ class acp_forums 'parent_id' => $this->parent_id, 'forum_type' => FORUM_POST, 'forum_status' => ITEM_UNLOCKED, - 'forum_name' => request_var('forum_name', '', true), + 'forum_name' => utf8_normalize_nfc(request_var('forum_name', '', true)), 'forum_link' => '', 'forum_link_track' => false, 'forum_desc' => '', diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 07088de75d..35499b132f 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -258,8 +258,8 @@ class acp_groups // Did we submit? if ($update) { - $group_name = request_var('group_name', '', true); - $group_desc = request_var('group_desc', '', true); + $group_name = utf8_normalize_nfc(request_var('group_name', '', true)); + $group_desc = utf8_normalize_nfc(request_var('group_desc', '', true)); $group_type = request_var('group_type', GROUP_FREE); $allow_desc_bbcode = request_var('desc_parse_bbcode', false); @@ -450,7 +450,7 @@ class acp_groups } else if (!$group_id) { - $group_name = request_var('group_name', '', true); + $group_name = utf8_normalize_nfc(request_var('group_name', '', true)); $group_desc_data = array( 'text' => '', 'allow_bbcode' => true, diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index f37448032e..33e5bea058 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -276,16 +276,16 @@ class acp_icons $image_width = (isset($_POST['width'])) ? request_var('width', array('' => 0)) : array(); $image_height = (isset($_POST['height'])) ? request_var('height', array('' => 0)) : array(); $image_add = (isset($_POST['add_img'])) ? request_var('add_img', array('' => 0)) : array(); - $image_emotion = request_var('emotion', array('' => ''), true); - $image_code = request_var('code', array('' => ''), true); + $image_emotion = utf8_normalize_nfc(request_var('emotion', array('' => ''), true)); + $image_code = utf8_normalize_nfc(request_var('code', array('' => ''), true)); $image_display_on_posting = (isset($_POST['display_on_posting'])) ? request_var('display_on_posting', array('' => 0)) : array(); // Ok, add the relevant bits if we are adding new codes to existing emoticons... if (!empty($_POST['add_additional_code'])) { $add_image = request_var('add_image', ''); - $add_code = request_var('add_code', '', true); - $add_emotion = request_var('add_emotion', '', true); + $add_code = utf8_normalize_nfc(request_var('add_code', '', true)); + $add_emotion = utf8_normalize_nfc(request_var('add_emotion', '', true)); if ($add_image && $add_emotion && $add_code) { diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 607bbd3cac..266729765d 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -146,8 +146,8 @@ class acp_language $sql_ary = array( 'lang_english_name' => request_var('lang_english_name', $row['lang_english_name']), - 'lang_local_name' => request_var('lang_local_name', $row['lang_local_name'], true), - 'lang_author' => request_var('lang_author', $row['lang_author'], true), + 'lang_local_name' => utf8_normalize_nfc(request_var('lang_local_name', $row['lang_local_name'], true)), + 'lang_author' => utf8_normalize_nfc(request_var('lang_author', $row['lang_author'], true)), ); $db->sql_query('UPDATE ' . LANG_TABLE . ' diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index 3daf5273cb..8148d648a3 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -232,7 +232,7 @@ class acp_modules 'module_enabled' => 0, 'module_display' => 1, 'parent_id' => 0, - 'module_langname' => request_var('module_langname', '', true), + 'module_langname' => utf8_normalize_nfc(request_var('module_langname', '', true)), 'module_mode' => '', 'module_auth' => '', ); @@ -245,7 +245,7 @@ class acp_modules $module_data['module_display'] = request_var('module_display', (int) $module_row['module_display']); $module_data['parent_id'] = request_var('module_parent_id', (int) $module_row['parent_id']); $module_data['module_class'] = $this->module_class; - $module_data['module_langname'] = request_var('module_langname', (string) $module_row['module_langname'], true); + $module_data['module_langname'] = utf8_normalize_nfc(request_var('module_langname', (string) $module_row['module_langname'], true)); $module_data['module_mode'] = request_var('module_mode', (string) $module_row['module_mode']); $submit = (isset($_POST['submit'])) ? true : false; diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php index 674468a862..57fd4c1ea5 100644 --- a/phpBB/includes/acp/acp_permission_roles.php +++ b/phpBB/includes/acp/acp_permission_roles.php @@ -134,8 +134,8 @@ class acp_permission_roles case 'add': - $role_name = request_var('role_name', '', true); - $role_description = request_var('role_description', '', true); + $role_name = utf8_normalize_nfc(request_var('role_name', '', true)); + $role_description = utf8_normalize_nfc(request_var('role_description', '', true)); $auth_settings = request_var('setting', array('' => 0)); if (!$role_name) @@ -214,8 +214,8 @@ class acp_permission_roles $options_from = request_var('options_from', 0); $role_row = array( - 'role_name' => request_var('role_name', '', true), - 'role_description' => request_var('role_description', '', true), + 'role_name' => utf8_normalize_nfc(request_var('role_name', '', true)), + 'role_description' => utf8_normalize_nfc(request_var('role_description', '', true)), 'role_type' => $permission_type, ); diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index f5ff319ece..bc6730abac 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -354,7 +354,7 @@ class acp_profile 'field_hide' => 0, 'field_no_view' => 0, 'field_show_on_reg' => 0, - 'lang_name' => request_var('field_ident', '', true), + 'lang_name' => utf8_normalize_nfc(request_var('field_ident', '', true)), 'lang_explain' => '', 'lang_default_value'=> '') ); @@ -382,9 +382,9 @@ class acp_profile } $cp->vars['field_ident'] = ($action == 'create' && $step == 1) ? utf8_clean_string(request_var('field_ident', $field_row['field_ident'], true)) : request_var('field_ident', $field_row['field_ident']); - $cp->vars['lang_name'] = request_var('lang_name', $field_row['lang_name'], true); - $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); + $cp->vars['lang_name'] = utf8_normalize_nfc(request_var('lang_name', $field_row['lang_name'], true)); + $cp->vars['lang_explain'] = utf8_normalize_nfc(request_var('lang_explain', $field_row['lang_explain'], true)); + $cp->vars['lang_default_value'] = utf8_normalize_nfc(request_var('lang_default_value', $field_row['lang_default_value'], true)); // Field option... if (isset($_REQUEST['field_option'])) @@ -409,11 +409,11 @@ class acp_profile // A boolean field expects an array as the lang options if ($field_type == FIELD_BOOL) { - $options = request_var('lang_options', array(''), true); + $options = utf8_normalize_nfc(request_var('lang_options', array(''), true)); } else { - $options = request_var('lang_options', '', true); + $options = utf8_normalize_nfc(request_var('lang_options', '', true)); } // If the user has submitted a form with options (i.e. dropdown field) @@ -441,13 +441,13 @@ class acp_profile // step 2 foreach ($exclude[2] as $key) { - $var = request_var($key, $field_row[$key], true); + $var = utf8_normalize_nfc(request_var($key, $field_row[$key], true)); // Manipulate the intended variables a little bit if needed if ($field_type == FIELD_DROPDOWN && $key == 'field_maxlen') { // Get the number of options if this key is 'field_maxlen' - $var = sizeof(explode("\n", request_var('lang_options', '', true))); + $var = sizeof(explode("\n", utf8_normalize_nfc(request_var('lang_options', '', true)))); } else if ($field_type == FIELD_TEXT && $key == 'field_length') { @@ -534,7 +534,7 @@ class acp_profile foreach ($exclude[3] as $key) { - $cp->vars[$key] = request_var($key, array(0 => ''), true); + $cp->vars[$key] = utf8_normalize_nfc(request_var($key, array(0 => ''), true)); if (!$cp->vars[$key] && $action == 'edit') { @@ -542,7 +542,7 @@ class acp_profile } else if ($key == 'l_lang_options' && $field_type == FIELD_BOOL) { - $cp->vars[$key] = request_var($key, array(0 => array('')), true); + $cp->vars[$key] = utf8_normalize_nfc(request_var($key, array(0 => array('')), true)); } else if ($key == 'l_lang_options' && is_array($cp->vars[$key])) { @@ -631,10 +631,10 @@ class acp_profile $cp->vars['columns'] = request_var('columns', 0); $_new_key_ary[$key] = $cp->vars['rows'] . '|' . $cp->vars['columns']; } + if ($field_type == FIELD_BOOL && $key == 'l_lang_options' && isset($_REQUEST['l_lang_options'])) { - $_new_key_ary[$key] = request_var($key, array(array('')), true); - + $_new_key_ary[$key] = utf8_normalize_nfc(request_var($key, array(array('')), true)); } else { @@ -644,7 +644,7 @@ class acp_profile } else { - $_new_key_ary[$key] = (is_array($_REQUEST[$key])) ? request_var($key, array(''), true) : request_var($key, '', true); + $_new_key_ary[$key] = (is_array($_REQUEST[$key])) ? utf8_normalize_nfc(request_var($key, array(''), true)) : utf8_normalize_nfc(request_var($key, '', true)); } } } @@ -915,7 +915,7 @@ class acp_profile $lang_options[$lang_id]['lang_iso'] = $lang_iso; foreach ($options as $field => $field_type) { - $value = ($action == 'create') ? request_var('l_' . $field, array(0 => ''), true) : $cp->vars['l_' . $field]; + $value = ($action == 'create') ? utf8_normalize_nfc(request_var('l_' . $field, array(0 => ''), true)) : $cp->vars['l_' . $field]; if ($field == 'lang_options') { @@ -1087,17 +1087,23 @@ class acp_profile } // These are always arrays because the key is the language id... - $cp->vars['l_lang_name'] = request_var('l_lang_name', array(0 => ''), true); - $cp->vars['l_lang_explain'] = request_var('l_lang_explain', array(0 => ''), true); - $cp->vars['l_lang_default_value'] = request_var('l_lang_default_value', array(0 => ''), true); + $cp->vars['l_lang_name'] = utf8_normalize_nfc(request_var('l_lang_name', array(0 => ''), true)); + $cp->vars['l_lang_explain'] = utf8_normalize_nfc(request_var('l_lang_explain', array(0 => ''), true)); + $cp->vars['l_lang_default_value'] = utf8_normalize_nfc(request_var('l_lang_default_value', array(0 => ''), true)); + if ($field_type != FIELD_BOOL) { - $cp->vars['l_lang_options'] = request_var('l_lang_options', array(0 => ''), true); + $cp->vars['l_lang_options'] = utf8_normalize_nfc(request_var('l_lang_options', array(0 => ''), true)); } else { + /** + * @todo check if this line is correct... $cp->vars['l_lang_default_value'] = request_var('l_lang_default_value', array(0 => array('')), true); + */ + $cp->vars['l_lang_options'] = utf8_normalize_nfc(request_var('l_lang_options', array(0 => array('')), true)); } + if ($cp->vars['lang_options']) { if (!is_array($cp->vars['lang_options'])) diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php index 08270a7221..950a645487 100644 --- a/phpBB/includes/acp/acp_ranks.php +++ b/phpBB/includes/acp/acp_ranks.php @@ -35,7 +35,7 @@ class acp_ranks { case 'save': - $rank_title = request_var('title', '', true); + $rank_title = utf8_normalize_nfc(request_var('title', '', true)); $special_rank = request_var('special_rank', 0); $min_posts = ($special_rank) ? 0 : request_var('min_posts', 0); $rank_image = request_var('rank_image', ''); diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php index 4fe76c7bbb..ca9fbcb806 100644 --- a/phpBB/includes/acp/acp_reasons.php +++ b/phpBB/includes/acp/acp_reasons.php @@ -38,8 +38,8 @@ class acp_reasons case 'edit': $reason_row = array( - 'reason_title' => request_var('reason_title', '', true), - 'reason_description' => request_var('reason_description', '', true) + 'reason_title' => utf8_normalize_nfc(request_var('reason_title', '', true)), + 'reason_description' => utf8_normalize_nfc(request_var('reason_description', '', true)), ); if ($submit) diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 1e0e3af54a..74659fe792 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -670,7 +670,7 @@ parse_css_file = {PARSE_CSS_FILE} $_POST['template_data'] = (isset($_POST['template_data']) && !empty($_POST['template_data'])) ? str_replace(array("\r\n", "\r"), array("\n", "\n"), $_POST['template_data']) : ''; $template_data = (STRIP) ? stripslashes($_POST['template_data']) : $_POST['template_data']; - $template_file = request_var('template_file', '', true); + $template_file = utf8_normalize_nfc(request_var('template_file', '', true)); $text_rows = max(5, min(999, request_var('text_rows', 20))); $save_changes = (isset($_POST['save'])) ? true : false; @@ -1025,7 +1025,7 @@ parse_css_file = {PARSE_CSS_FILE} $_POST['template_data'] = (isset($_POST['template_data']) && !empty($_POST['template_data'])) ? str_replace(array("\r\n", "\r"), array("\n", "\n"), $_POST['template_data']) : ''; $theme_data = (STRIP) ? stripslashes($_POST['template_data']) : $_POST['template_data']; - $theme_file = request_var('template_file', '', true); + $theme_file = utf8_normalize_nfc(request_var('template_file', '', true)); $text_rows = max(5, min(999, request_var('text_rows', 20))); $save_changes = (isset($_POST['save'])) ? true : false; @@ -2016,8 +2016,8 @@ parse_css_file = {PARSE_CSS_FILE} if ($update) { - $name = request_var('name', '', true); - $copyright = request_var('copyright', '', true); + $name = utf8_normalize_nfc(request_var('name', '', true)); + $copyright = utf8_normalize_nfc(request_var('copyright', '', true)); $template_id = request_var('template_id', 0); $theme_id = request_var('theme_id', 0); @@ -2652,8 +2652,8 @@ parse_css_file = {PARSE_CSS_FILE} $error = array(); $style_row = array( - $mode . '_name' => request_var('name', '', true), - $mode . '_copyright' => request_var('copyright', '', true), + $mode . '_name' => utf8_normalize_nfc(request_var('name', '', true)), + $mode . '_copyright' => utf8_normalize_nfc(request_var('copyright', '', true)), 'template_id' => 0, 'theme_id' => 0, 'imageset_id' => 0, diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 8f5fd8d0de..5b6a790e97 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -30,11 +30,8 @@ class acp_users $this->tpl_name = 'acp_users'; $this->page_title = 'ACP_USER_' . strtoupper($mode); - include($phpbb_root_path . 'includes/functions_user.' . $phpEx); - include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); - $error = array(); - $username = request_var('username', '', true); + $username = utf8_normalize_nfc(request_var('username', '', true)); $user_id = request_var('u', 0); $action = request_var('action', ''); @@ -43,6 +40,8 @@ class acp_users // Whois (special case) if ($action == 'whois') { + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + $this->page_title = 'WHOIS'; $this->tpl_name = 'simple_body'; @@ -148,6 +147,8 @@ class acp_users { case 'overview': + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + $user->add_lang('acp/ban'); $delete = request_var('delete', 0); @@ -248,8 +249,8 @@ class acp_users break; } - $ban_reason = request_var('ban_reason', $user->lang[$reason], true); - $ban_give_reason = request_var('ban_give_reason', '', true); + $ban_reason = utf8_normalize_nfc(request_var('ban_reason', $user->lang[$reason], true)); + $ban_give_reason = utf8_normalize_nfc(request_var('ban_give_reason', '', true)); // Log not used at the moment, we simply utilize the ban function. $result = user_ban(substr($action, 3), $ban, 0, 0, 0, $ban_reason, $ban_give_reason); @@ -598,7 +599,7 @@ class acp_users // Handle registration info updates $data = array( - 'username' => request_var('user', $user_row['username'], true), + 'username' => utf8_normalize_nfc(request_var('user', $user_row['username'], true)), 'user_founder' => request_var('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0), 'email' => strtolower(request_var('user_email', $user_row['user_email'])), 'email_confirm' => strtolower(request_var('email_confirm', '')), @@ -867,7 +868,7 @@ class acp_users $deletemark = (isset($_POST['delmarked'])) ? true : false; $deleteall = (isset($_POST['delall'])) ? true : false; $marked = request_var('mark', array(0)); - $message = request_var('message', '', true); + $message = utf8_normalize_nfc(request_var('message', '', true)); // Sort keys $sort_days = request_var('st', 0); @@ -952,6 +953,9 @@ class acp_users case 'profile': + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); + $cp = new custom_profile(); $cp_data = $cp_error = array(); @@ -1147,8 +1151,10 @@ class acp_users case 'prefs': + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + $data = array( - 'dateformat' => request_var('dateformat', $user_row['user_dateformat'], true), + 'dateformat' => utf8_normalize_nfc(request_var('dateformat', $user_row['user_dateformat'], true)), 'lang' => basename(request_var('lang', $user_row['user_lang'])), 'tz' => request_var('tz', (float) $user_row['user_timezone']), 'style' => request_var('style', $user_row['user_style']), @@ -1352,6 +1358,7 @@ class acp_users case 'avatar': include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false; @@ -1652,6 +1659,8 @@ class acp_users case 'groups': + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + $user->add_lang(array('groups', 'acp/groups')); $group_id = request_var('g', 0); diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php index 5e223b1980..d7c1b28b77 100644 --- a/phpBB/includes/mcp/mcp_ban.php +++ b/phpBB/includes/mcp/mcp_ban.php @@ -38,11 +38,17 @@ class mcp_ban // Grab the list of entries $ban = request_var('ban', '', ($mode === 'user') ? true : false); + + if ($mode === 'user') + { + $ban = utf8_normalize_nfc($ban); + } + $ban_len = request_var('banlength', 0); $ban_len_other = request_var('banlengthother', ''); $ban_exclude = request_var('banexclude', 0); - $ban_reason = request_var('banreason', '', true); - $ban_give_reason = request_var('bangivereason', '', true); + $ban_reason = utf8_normalize_nfc(request_var('banreason', '', true)); + $ban_give_reason = utf8_normalize_nfc(request_var('bangivereason', '', true)); if ($ban) diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index bc4782abea..391d41b6fb 100755 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -103,7 +103,7 @@ class mcp_notes $deletemark = ($action == 'del_marked') ? true : false; $deleteall = ($action == 'del_all') ? true : false; $marked = request_var('marknote', array(0)); - $usernote = request_var('usernote', '', true); + $usernote = utf8_normalize_nfc(request_var('usernote', '', true)); // Handle any actions if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 1259944439..1e908b1c1f 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -734,7 +734,7 @@ function disapprove_post($post_id_list, $id, $mode) } $redirect = request_var('redirect', build_url(array('t', 'mode', '_f_', 'quickmod')) . '&mode=unapproved_topics'); - $reason = request_var('reason', '', true); + $reason = utf8_normalize_nfc(request_var('reason', '', true)); $reason_id = request_var('reason_id', 0); $success_msg = $additional_msg = ''; diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 6fd0f52d6f..915df898f7 100755 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -191,7 +191,7 @@ class mcp_warn $post_id = request_var('p', 0); $forum_id = request_var('f', 0); $notify = (isset($_REQUEST['notify_user'])) ? true : false; - $warning = request_var('warning', '', true); + $warning = utf8_normalize_nfc(request_var('warning', '', true)); $sql = 'SELECT u.*, p.* FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u @@ -306,7 +306,7 @@ class mcp_warn $user_id = request_var('u', 0); $username = request_var('username', '', true); $notify = (isset($_REQUEST['notify_user'])) ? true : false; - $warning = request_var('warning', '', true); + $warning = utf8_normalize_nfc(request_var('warning', '', true)); $sql_where = ($user_id) ? "user_id = $user_id" : "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 1e8bd23af9..44b5498ca7 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -454,8 +454,8 @@ class ucp_groups // Did we submit? if ($update) { - $group_name = request_var('group_name', '', true); - $group_desc = request_var('group_desc', '', true); + $group_name = utf8_normalize_nfc(request_var('group_name', '', true)); + $group_desc = utf8_normalize_nfc(request_var('group_desc', '', true)); $group_type = request_var('group_type', GROUP_FREE); $allow_desc_bbcode = request_var('desc_parse_bbcode', false); @@ -591,7 +591,7 @@ class ucp_groups } else if (!$group_id) { - $group_name = request_var('group_name', '', true); + $group_name = utf8_normalize_nfc(request_var('group_name', '', true)); $group_desc_data = array( 'text' => '', 'allow_bbcode' => true, @@ -951,7 +951,7 @@ class ucp_groups $user->add_lang(array('acp/groups', 'acp/common')); - $names = request_var('usernames', '', true); + $names = utf8_normalize_nfc(request_var('usernames', '', true)); if (!$group_id) { diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php index f242c864b6..95326090c7 100644 --- a/phpBB/includes/ucp/ucp_pm_options.php +++ b/phpBB/includes/ucp/ucp_pm_options.php @@ -60,7 +60,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit // Add Folder if (isset($_POST['addfolder'])) { - $folder_name = request_var('foldername', '', true); + $folder_name = utf8_normalize_nfc(request_var('foldername', '', true)); if ($folder_name) { @@ -104,7 +104,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit // Rename folder if (isset($_POST['rename_folder'])) { - $new_folder_name = request_var('new_folder_name', '', true); + $new_folder_name = utf8_normalize_nfc(request_var('new_folder_name', '', true)); $rename_folder_id= request_var('rename_folder_id', 0); if (!$new_folder_name) diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 2dab4af710..b62ee04318 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -79,7 +79,7 @@ class ucp_register { // We do not include the password! $s_hidden_fields = array_merge($s_hidden_fields, array( - 'username' => request_var('username', '', true), + 'username' => utf8_normalize_nfc(request_var('username', '', true)), 'email' => strtolower(request_var('email', '')), 'email_confirm' => strtolower(request_var('email_confirm', '')), 'confirm_code' => request_var('confirm_code', ''), diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index c9a79cc0df..b4ad6a7af9 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -1787,7 +1787,17 @@ function utf8_normalize_nfc($strings) { foreach ($strings as $key => $string) { - utf_normalizer::nfc($strings[$key]); + if (is_array($string)) + { + foreach ($string as $_key => $_string) + { + utf_normalizer::nfc($strings[$key][$_key]); + } + } + else + { + utf_normalizer::nfc($strings[$key]); + } } } |