aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/posting.php
diff options
context:
space:
mode:
authorNicofuma <github@nicofuma.fr>2015-05-19 23:35:58 +0200
committerNicofuma <github@nicofuma.fr>2015-05-19 23:35:58 +0200
commit5e6c026527077f2ea57311cfd7ca2abce331ae0b (patch)
treefc5751ac24f842d266d6502c3fbbe783603627ff /phpBB/posting.php
parentd7e2f488a45da99c845912925fe84d501c5d6da2 (diff)
parent2cc78b2c3b4e918710478f861c1441a3e28c9ad4 (diff)
downloadforums-5e6c026527077f2ea57311cfd7ca2abce331ae0b.tar
forums-5e6c026527077f2ea57311cfd7ca2abce331ae0b.tar.gz
forums-5e6c026527077f2ea57311cfd7ca2abce331ae0b.tar.bz2
forums-5e6c026527077f2ea57311cfd7ca2abce331ae0b.tar.xz
forums-5e6c026527077f2ea57311cfd7ca2abce331ae0b.zip
Merge pull request #3617 from s9e/ticket/11530
[ticket/11530] Remove extra quotes when depth limit is exceeded
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r--phpBB/posting.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 2d01922c80..a4fb4d7a8d 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1578,11 +1578,22 @@ 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 && preg_match('#^<[rt][ >]#', $message_parser->message))
+{
+ $message_parser->message = $phpbb_container->get('text_formatter.utils')->remove_bbcode(
+ $message_parser->message,
+ 'quote',
+ $config['max_quote_depth'] - 1
+ );
+}
+
// 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'])
{