aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/message_parser.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-03-22 16:34:26 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-03-22 16:34:26 +0000
commit4cbf6bc703bdadf716197b68a89b3438247ff022 (patch)
tree952f7fe84b9428d10e4d49d535c5108e06d4640a /phpBB/includes/message_parser.php
parentfac9c024ff370eb4c34f7a7ffa9048732e5c74c7 (diff)
downloadforums-4cbf6bc703bdadf716197b68a89b3438247ff022.tar
forums-4cbf6bc703bdadf716197b68a89b3438247ff022.tar.gz
forums-4cbf6bc703bdadf716197b68a89b3438247ff022.tar.bz2
forums-4cbf6bc703bdadf716197b68a89b3438247ff022.tar.xz
forums-4cbf6bc703bdadf716197b68a89b3438247ff022.zip
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
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r--phpBB/includes/message_parser.php20
1 files changed, 12 insertions, 8 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index dd44e403f4..9a13d2d14c 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -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=&quot;(.*?)&quot;\]#ie', "'quote=&quot;' . str_replace(array('[', ']'), array('&#91;', '&#93;'), '\$1') . '&quot;]'", $in);
+ $in = preg_replace('#quote=&quot;(.*?)&quot;\]#ie', "'quote=&quot;' . str_replace(array('[', ']', '\\\"'), array('&#91;', '&#93;', '\"'), '\$1') . '&quot;]'", $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'])
{