Comment 6 for bug 882894

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/1036
Committed: http://gitorious.org/mahara/mahara/commit/1c022eed9e695f639f49c35ece191ddda1a6cb05
Submitter: Francois Marier (<email address hidden>)
Branch: master

commit 1c022eed9e695f639f49c35ece191ddda1a6cb05
Author: Richard Mansfield <email address hidden>
Date: Fri Feb 3 11:40:34 2012 +1300

    Remove unnecessary sanitisation from forum notifications (bug #882894)

    In commit 93c012f2e1f, the forum and group name were added to the body
    of forum post email notifications, each wrapped in a call to
    clean_html (htmlpurifier). This crashes cron due to out-of-memory
    errors whenever there are more than a few subscribers, and stops
    notifications from being sent out at all.

    The forum and group name only need to be rendered once per forum post,
    so this could be fixed by moving the clean_html call up to the
    activity constructor, rather than doing it in the get_emailmessage,
    get_htmlmessage functions. These functions get called for every
    single subscriber notification, to ensure the string is displayed in
    the subscriber's language.

    But because group and forum names are never rendered as html, we don't
    need to use htmlpurifier - html escaping is more appropriate and less
    memory-hungry.

    Change-Id: I0a4133b0a11e0e0004bdab1c29984ab4fc5dfbbf
    Signed-off-by: Richard Mansfield <email address hidden>