Remove nested quotes at given depth in current parsed message
public remove_nested_quotes ( integer $max_depth ) : null | ||
$max_depth | integer | Depth limit |
Résultat | null |
parse_attachments($forum_id, $preview_message, $attachment_data, $update_count, true); foreach ($attachment_data as $i => $attachment) { $template->assign_block_vars('attachment', array('DISPLAY_ATTACHMENT' => $attachment)); } unset($attachment_data); } if (!sizeof($error)) { $template->assign_vars(array('PREVIEW_SUBJECT' => $preview_subject, 'PREVIEW_MESSAGE' => $preview_message, 'PREVIEW_SIGNATURE' => $preview_signature, 'S_DISPLAY_PREVIEW' => !empty($preview_message))); } } // 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 ($generate_quote) { if ($config['allow_bbcode']) { $message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n"; } else { $offset = 0; $quote_string = "> "; $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, ">") !== false) { $offset = 10;