aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/message_parser.php16
-rw-r--r--phpBB/includes/ucp/ucp_resend.php3
2 files changed, 16 insertions, 3 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index f80715f211..e9729445f2 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -672,6 +672,11 @@ class bbcode_firstpass extends bbcode
{
global $config, $user;
+ /**
+ * If you change this code, make sure the cases described within the following reports are still working:
+ * #3572, #14667
+ */
+
$in = str_replace("\r\n", "\n", str_replace('\"', '"', trim($in)));
if (!$in)
@@ -801,12 +806,19 @@ class bbcode_firstpass extends bbcode
{
// Search the text for the next tok... if an ending quote comes first, then change tok to []
$pos1 = strpos($in, '[/quote');
+ // If the token ] comes first, we change it to ]
$pos2 = strpos($in, ']');
+ // If the token [ comes first, we change it to [
+ $pos3 = strpos($in, '[');
- if ($pos1 !== false && ($pos2 === false || $pos1 < $pos2))
+ if ($pos1 !== false && ($pos2 === false || $pos1 < $pos2) && ($pos3 === false || $pos1 < $pos3))
{
$tok = '[]';
}
+ else if ($pos3 !== false && ($pos2 === false || $pos3 < $pos2))
+ {
+ $tok = '[';
+ }
else
{
$tok = ']';
@@ -1049,7 +1061,7 @@ class parse_message extends bbcode_firstpass
$this->message = preg_replace($match, $replace, trim($this->message));
// Message length check. -1 disables this check completely.
- if ($config['max_' . $mode . '_chars'] != -1)
+ if ($config['max_' . $mode . '_chars'])
{
$msg_len = ($mode == 'post') ? utf8_strlen($this->message) : utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message));
diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php
index ea5e0d8b17..48176a3989 100644
--- a/phpBB/includes/ucp/ucp_resend.php
+++ b/phpBB/includes/ucp/ucp_resend.php
@@ -146,7 +146,8 @@ class ucp_resend
meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
- $message = $user->lang['ACTIVATION_EMAIL_SENT'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
+ $message = ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? $user->lang['ACIVATION_EMAIL_SENT_ADMIN'] : $user->lang['ACTIVATION_EMAIL_SENT'];
+ $message .= '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
trigger_error($message);
}