2018-03-17, 01:48 PM
MyBB 1.8.14
MyBB is not removing mycode from email notifications of the posts that create a thread (it does so for replies). In addition, it does not properly remove nested mycodes. The following chnages were made to resolve the issue.
inc/datahandlers/post.php:
inc/class_parser.php: (the loop count limit can be any reasonable value and the count is there as a defensive programming failsafe to insure there is no infinite loop).
MyBB is not removing mycode from email notifications of the posts that create a thread (it does so for replies). In addition, it does not properly remove nested mycodes. The following chnages were made to resolve the issue.
inc/datahandlers/post.php:
Quote:< $excerpt = my_substr($thread['message'], 0, $mybb->settings['subscribeexcerpt']).$lang->emailbit_viewthread;
---
> // SPMOD: delay till later $excerpt = my_substr($thread['message'], 0, $mybb->settings['subscribeexcerpt']).$lang->emailbit_viewthread;
> $excerpt = $thread['message'];
1617a1619,1621
> $excerpt = $parser->text_parse_message($excerpt);
> if (strlen($excerpt) > $mybb->settings['subscribeexcerpt'])
> $excerpt = my_substr($excerpt, 0, $mybb->settings['subscribeexcerpt']).$lang->emailbit_viewthread;
inc/class_parser.php: (the loop count limit can be any reasonable value and the count is there as a defensive programming failsafe to insure there is no infinite loop).
Quote:< $message = preg_replace($find, $replace, $message);
---
> $messageBefore = "";
> for ($cnt = 1; $cnt < 5 && $message != $messageBefore; $cnt++)
> {
> $messageBefore = $message;
> $message = preg_replace($find, $replace, $messageBefore);
> }