1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

Merge most changes from 3.0.x branch since the 25th december.

(Captcha changes for refreshing captcha image not included)

git-svn-id: file:///svn/phpbb/trunk@9404 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2009-03-22 16:34:26 +00:00
parent fac9c024ff
commit 4cbf6bc703
80 changed files with 2491 additions and 916 deletions

View File

@@ -684,6 +684,7 @@ class bbcode_firstpass extends bbcode
* [quote="[i]test[/i]"]test[/quote] (correct: parsed)
* [quote="[quote]test[/quote]"]test[/quote] (correct: parsed - Username displayed as [quote]test[/quote])
* #20735 - [quote]test[/[/b]quote] test [/quote][/quote] test - (correct: quoted: "test[/[/b]quote] test" / non-quoted: "[/quote] test" - also failed if layout distorted)
* #40565 - [quote="a"]a[/quote][quote="a]a[/quote] (correct: first quote tag parsed, second quote tag unparsed)
*/
$in = str_replace("\r\n", "\n", str_replace('\"', '"', trim($in)));
@@ -694,7 +695,7 @@ class bbcode_firstpass extends bbcode
}
// 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);
$in = preg_replace('#quote="(.*?)"\]#ie', "'quote="' . str_replace(array('[', ']', '\\\"'), array('[', ']', '\"'), '\$1') . '"]'", $in);
$tok = ']';
$out = '[';
@@ -847,6 +848,8 @@ class bbcode_firstpass extends bbcode
}
while ($in);
$out .= $buffer;
if (sizeof($close_tags))
{
$out .= '[' . implode('][', $close_tags) . ']';
@@ -1085,13 +1088,6 @@ class parse_message extends bbcode_firstpass
}
}
// Check for "empty" message
if ($mode !== 'sig' && utf8_clean_string($this->message) === '')
{
$this->warn_msg[] = phpbb::$user->lang['TOO_FEW_CHARS'];
return (!$update_this_message) ? $return_message : $this->warn_msg;
}
// Prepare BBcode (just prepares some tags for better parsing)
if ($allow_bbcode && strpos($this->message, '[') !== false)
{
@@ -1134,6 +1130,14 @@ class parse_message extends bbcode_firstpass
}
}
// Check for "empty" message. We do not check here for maximum length, because bbcode, smilies, etc. can add to the length.
// The maximum length check happened before any parsings.
if ($mode !== 'sig' && utf8_clean_string($this->message) === '')
{
$this->warn_msg[] = $user->lang['TOO_FEW_CHARS'];
return (!$update_this_message) ? $return_message : $this->warn_msg;
}
// Check number of links
if (phpbb::$config['max_' . $mode . '_urls'] && $num_urls > phpbb::$config['max_' . $mode . '_urls'])
{