mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-09 02:06:32 +02:00
fixed username validation if username is already parsed through htmlspecialchars or user try to enforce invalid characters. git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3522 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -576,6 +576,9 @@ function bbencode_second_pass_code($text, $uid, $bbcode_tpl)
|
||||
// Replace tabs with " " so tabbed code indents sorta right without making huge long lines.
|
||||
$after_replace = str_replace("\t", " ", $after_replace);
|
||||
|
||||
// now Replace space occurring at the beginning of a line
|
||||
$after_replace = preg_replace("/^ {1}/m", ' ', $after_replace);
|
||||
|
||||
$str_to_match = "[code:1:$uid]" . $before_replace . "[/code:1:$uid]";
|
||||
|
||||
$replacement = $code_start_html;
|
||||
|
@@ -99,7 +99,7 @@ function validate_username($username)
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Don't allow " in username.
|
||||
if (strstr($username, '"'))
|
||||
if (strstr($username, '"') || strstr($username, '"'))
|
||||
{
|
||||
return array('error' => true, 'error_msg' => $lang['Username_invalid']);
|
||||
}
|
||||
|
@@ -799,6 +799,15 @@ else
|
||||
$template->assign_block_vars('switch_edit_profile', array());
|
||||
}
|
||||
|
||||
if ( ($mode == 'register') || ($board_config['allow_namechange']) )
|
||||
{
|
||||
$template->assign_block_vars('switch_namechange_allowed', array());
|
||||
}
|
||||
else
|
||||
{
|
||||
$template->assign_block_vars('switch_namechange_disallowed', array());
|
||||
}
|
||||
|
||||
//
|
||||
// Let's do an overall check for settings/versions which would prevent
|
||||
// us from doing file uploads....
|
||||
|
Reference in New Issue
Block a user