mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
fixing some annoying bugs
git-svn-id: file:///svn/phpbb/trunk@8204 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -674,7 +674,11 @@ class bbcode_firstpass extends bbcode
|
||||
|
||||
/**
|
||||
* If you change this code, make sure the cases described within the following reports are still working:
|
||||
* #3572, #14667
|
||||
* #3572 - [quote="[test]test"]test [ test[/quote] - (correct: parsed)
|
||||
* #14667 - [quote]test[/quote] test ] and [ test [quote]test[/quote] (correct: parsed)
|
||||
* #14770 - [quote="["]test[/quote] (correct: parsed)
|
||||
* [quote="[i]test[/i]"]test[/quote] (correct: parsed)
|
||||
* [quote="[quote]test[/quote]"]test[/quote] (correct: NOT parsed)
|
||||
*/
|
||||
|
||||
$in = str_replace("\r\n", "\n", str_replace('\"', '"', trim($in)));
|
||||
@@ -684,6 +688,9 @@ class bbcode_firstpass extends bbcode
|
||||
return '';
|
||||
}
|
||||
|
||||
// To let the parser not catch tokens within quote_username quotes we encode them before we start this...
|
||||
$in = preg_replace('#quote="(.*?)"\]#ie', "'quote="' . str_replace(array('[', ']'), array('[', ']'), '\$1') . '"]'", $in);
|
||||
|
||||
$tok = ']';
|
||||
$out = '[';
|
||||
|
||||
@@ -745,7 +752,9 @@ class bbcode_firstpass extends bbcode
|
||||
|
||||
if (isset($m[1]) && $m[1])
|
||||
{
|
||||
$username = preg_replace('#\[(?!b|i|u|color|url|email|/b|/i|/u|/color|/url|/email)#iU', '[$1', $m[1]);
|
||||
$username = str_replace(array('[', ']'), array('[', ']'), $m[1]);
|
||||
$username = preg_replace('#\[(?!b|i|u|color|url|email|/b|/i|/u|/color|/url|/email)#iU', '[$1', $username);
|
||||
|
||||
$end_tags = array();
|
||||
$error = false;
|
||||
|
||||
@@ -765,7 +774,7 @@ class bbcode_firstpass extends bbcode
|
||||
|
||||
if ($error)
|
||||
{
|
||||
$username = str_replace('[', '[', str_replace(']', ']', $m[1]));
|
||||
$username = $m[1];
|
||||
}
|
||||
|
||||
$out .= 'quote="' . $username . '":' . $this->bbcode_uid . ']';
|
||||
@@ -1073,7 +1082,7 @@ class parse_message extends bbcode_firstpass
|
||||
}
|
||||
|
||||
// Check for "empty" message
|
||||
if (!utf8_clean_string($this->message))
|
||||
if ($mode !== 'sig' && !utf8_clean_string($this->message))
|
||||
{
|
||||
$this->warn_msg[] = $user->lang['TOO_FEW_CHARS'];
|
||||
return $this->warn_msg;
|
||||
|
Reference in New Issue
Block a user