diff options
| author | JoshyPHP <s9e.dev@gmail.com> | 2015-05-30 01:02:12 +0200 |
|---|---|---|
| committer | JoshyPHP <s9e.dev@gmail.com> | 2015-06-27 02:52:26 +0200 |
| commit | 817db2f13526842e04aeabe4fcd6d809dce2d0a2 (patch) | |
| tree | 50bfc83d6b64cc3543a446ee22b5eb32c143d6eb /phpBB/posting.php | |
| parent | 7d7b536874aa7eae7a6c5451d1ed8ee1dc62a1df (diff) | |
| download | forums-817db2f13526842e04aeabe4fcd6d809dce2d0a2.tar forums-817db2f13526842e04aeabe4fcd6d809dce2d0a2.tar.gz forums-817db2f13526842e04aeabe4fcd6d809dce2d0a2.tar.bz2 forums-817db2f13526842e04aeabe4fcd6d809dce2d0a2.tar.xz forums-817db2f13526842e04aeabe4fcd6d809dce2d0a2.zip | |
[ticket/13880] Automatically remove quotes that are nested too deep
PHPBB3-13880
Diffstat (limited to 'phpBB/posting.php')
| -rw-r--r-- | phpBB/posting.php | 12 |
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']) { |
