aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/posting.php
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2015-06-29 11:33:00 +0200
committerTristan Darricau <tristan.darricau@sensiolabs.com>2015-06-29 11:33:00 +0200
commit2be39c5a8f3b587f2fe091862e7021ae70d9fcda (patch)
tree27ee4c883d69aa541977f795ab64831948ff40db /phpBB/posting.php
parent7b903919bf17856fa1f16d9ad386c4b47e48bc81 (diff)
parentae2237f640c5f08924b01e780d9549dddcb1b7da (diff)
downloadforums-2be39c5a8f3b587f2fe091862e7021ae70d9fcda.tar
forums-2be39c5a8f3b587f2fe091862e7021ae70d9fcda.tar.gz
forums-2be39c5a8f3b587f2fe091862e7021ae70d9fcda.tar.bz2
forums-2be39c5a8f3b587f2fe091862e7021ae70d9fcda.tar.xz
forums-2be39c5a8f3b587f2fe091862e7021ae70d9fcda.zip
Merge pull request #3654 from s9e/ticket/13880
[ticket/13880] Automatically remove quotes that are nested too deep
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r--phpBB/posting.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 651f674ef9..d994811a91 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1579,11 +1579,21 @@ if (!sizeof($error) && $preview)
}
}
+// Remove quotes that would become nested too deep before decoding the text
+$generate_quote = ($mode == 'quote' && !$submit && !$preview && !$refresh);
+if ($generate_quote && $config['max_quote_depth'] > 0)
+{
+ $tmp_bbcode_uid = $message_parser->bbcode_uid;
+ $message_parser->bbcode_uid = $post_data['bbcode_uid'];
+ $message_parser->remove_nested_quotes($config['max_quote_depth'] - 1);
+ $message_parser->bbcode_uid = $tmp_bbcode_uid;
+}
+
// Decode text for message display
$post_data['bbcode_uid'] = ($mode == 'quote' && !$preview && !$refresh && !sizeof($error)) ? $post_data['bbcode_uid'] : $message_parser->bbcode_uid;
$message_parser->decode_message($post_data['bbcode_uid']);
-if ($mode == 'quote' && !$submit && !$preview && !$refresh)
+if ($generate_quote)
{
if ($config['allow_bbcode'])
{