aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/posting.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2018-10-08 21:35:38 +0200
committerMarc Alexander <admin@m-a-styles.de>2018-10-08 21:35:38 +0200
commitdd43c6a61ea189c14c909eb87c8311102b8da2b0 (patch)
tree47fda2642b0d3156432cb0055bb33ecb3c514775 /phpBB/posting.php
parente1abc3105b309cfe4573b6422d12bce6137a939a (diff)
parent4396bfba65b0c69023b47b564f789700f892e05a (diff)
downloadforums-dd43c6a61ea189c14c909eb87c8311102b8da2b0.tar
forums-dd43c6a61ea189c14c909eb87c8311102b8da2b0.tar.gz
forums-dd43c6a61ea189c14c909eb87c8311102b8da2b0.tar.bz2
forums-dd43c6a61ea189c14c909eb87c8311102b8da2b0.tar.xz
forums-dd43c6a61ea189c14c909eb87c8311102b8da2b0.zip
Merge pull request #5296 from MikelAlejoBR/ticket/15622
[ticket/15622] Fix quoting in PMs when BBCodes are disabled
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r--phpBB/posting.php35
1 files changed, 7 insertions, 28 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php
index d97a22209f..8d40652574 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1627,35 +1627,14 @@ if ($generate_quote)
// Remove attachment bbcode tags from the quoted message to avoid mixing with the new post attachments if any
$message_parser->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#uis', '\\2', $message_parser->message);
- if ($config['allow_bbcode'])
- {
- $message_parser->message = $bbcode_utils->generate_quote(
- censor_text($message_parser->message),
- array(
- 'author' => $post_data['quote_username'],
- 'post_id' => $post_data['post_id'],
- 'time' => $post_data['post_time'],
- 'user_id' => $post_data['poster_id'],
- )
- );
- $message_parser->message .= "\n\n";
- }
- else
- {
- $offset = 0;
- $quote_string = "&gt; ";
- $message = censor_text(trim($message_parser->message));
- // see if we are nesting. It's easily tricked but should work for one level of nesting
- if (strpos($message, "&gt;") !== false)
- {
- $offset = 10;
- }
- $message = utf8_wordwrap($message, 75 + $offset, "\n");
+ $quote_attributes = array(
+ 'author' => $post_data['quote_username'],
+ 'post_id' => $post_data['post_id'],
+ 'time' => $post_data['post_time'],
+ 'user_id' => $post_data['poster_id'],
+ );
- $message = $quote_string . $message;
- $message = str_replace("\n", "\n" . $quote_string, $message);
- $message_parser->message = $post_data['quote_username'] . " " . $user->lang['WROTE'] . ":\n" . $message . "\n";
- }
+ phpbb_format_quote($config['allow_bbcode'], $quote_attributes, $bbcode_utils, $message_parser);
}
if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh)