From 0ca32c41b5f82f333d8deaf0f51f677d2a5e2388 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 27 Mar 2016 19:09:06 +0700 Subject: [PATCH] [ticket/14559] Remove attachment BBCode tags from the quoted message PHPBB3-14559 --- phpBB/posting.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpBB/posting.php b/phpBB/posting.php index 263809e998..653740ae1c 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1589,6 +1589,9 @@ $message_parser->decode_message($post_data['bbcode_uid']); 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 = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";