The feature to remove nested quoting is broken a la http://www.simplemachines.org/community/index.php?topic=450841.0
I then tested it myself. Ironically, it removed my second first-level quote!
So I spent the evening trying to fix it. I didn't try the proposed tweak, because I felt that it wouldn't do it right. Instead, I sniffed around and ended up with this here'code[1]:
Code: [Select]
I then tested it myself. Ironically, it removed my second first-level quote!
So I spent the evening trying to fix it. I didn't try the proposed tweak, because I felt that it wouldn't do it right. Instead, I sniffed around and ended up with this here'code[1]:
// Remove any nested quotes, if necessary.
if (!empty($modSettings['removeNestedQuotes']))
$pattern = "/\[quote(.*?)\](((?R)|.)*?)\[\/quote\]/is";
preg_match_all($pattern, $form_message, $matches, PREG_SET_ORDER);
foreach ($matches as $match)
{
$block = preg_replace(array('~\[quote(.*?)\](((?R)|.)*?)\[\/quote\]~is', '~^\n~', '~\[/quote\]~'), '', $match[2], -1, $count);
$form_message = str_replace($match[2], $block, $form_message);
}| 1. | A bit messy, could use a bit of cleanup. Maybe it could be a user option instead of an admin setting. |







