mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 16:56:44 +02:00
Fixed bug 478218 -- [ and ] in usernames qith quote= bbcode. Usernames can no longer contain the double-quote character. Also removed a dupe from lang_main file.
git-svn-id: file:///svn/phpbb/trunk@1441 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -167,7 +167,7 @@ function bbencode_second_pass($text, $uid)
|
||||
$text = str_replace("[quote:$uid]", $bbcode_tpl['quote_open'], $text);
|
||||
$text = str_replace("[/quote:$uid]", $bbcode_tpl['quote_close'], $text);
|
||||
|
||||
$text = preg_replace("/\[quote:$uid=(.*?)\]/si", $bbcode_tpl['quote_username_open'], $text);
|
||||
$text = preg_replace("/\[quote:$uid=\"?(.*?)\"?\]/si", $bbcode_tpl['quote_username_open'], $text);
|
||||
|
||||
// [b] and [/b] for bolding text.
|
||||
$text = str_replace("[b:$uid]", $bbcode_tpl['b_open'], $text);
|
||||
@@ -240,7 +240,7 @@ function bbencode_first_pass($text, $uid)
|
||||
// [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff.
|
||||
$text = bbencode_first_pass_pda($text, $uid, '[quote]', '[/quote]', '', false, '');
|
||||
|
||||
$text = bbencode_first_pass_pda($text, $uid, '/\[quote=(.*?)\]/is', '[/quote]', '', false, '', "[quote:$uid=\\1]");
|
||||
$text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\\".*?\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\1]");
|
||||
|
||||
// [list] and [list=x] for (un)ordered lists.
|
||||
$open_tag = array();
|
||||
@@ -276,8 +276,6 @@ function bbencode_first_pass($text, $uid)
|
||||
// Remove our padding from the string..
|
||||
$text = substr($text, 1);
|
||||
|
||||
// Add the uid tag to the start of the string..
|
||||
//$text = '[uid=' . $uid . ']' . $text;
|
||||
|
||||
return $text;
|
||||
|
||||
|
@@ -476,6 +476,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
|
||||
|
||||
//
|
||||
// Check to see if the username has been taken, or if it is disallowed.
|
||||
// Also checks if it includes the " character, which we don't allow in usernames.
|
||||
// Used for registering, changing names, and posting anonymously with a username
|
||||
//
|
||||
function validate_username($username)
|
||||
@@ -550,6 +551,12 @@ function validate_username($username)
|
||||
}
|
||||
}
|
||||
|
||||
// Don't allow " in username.
|
||||
if ( strstr($username, '"') )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user