Moodle

Blog contents are processed by format_text() twice

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8.8, 1.9.4
  • Fix Version/s: 1.8.9, 1.9.5
  • Component/s: Blog
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE

Description

While testing http://moodle.org/mod/forum/discuss.php?d=114466

I've detected that something in blogs is causing wrong output of contents. After some reseach, it seems that the blog_print_entry() function performs a format_text() with contents twice:

$template['body'] = format_text($blogEntry->summary, $blogEntry->format);
...
...
echo format_text($template['body']);

with the second call, breaking the output generated by the first, noticeable <object> tags and so on from filters.

So I'm going to erase the second call, outputting directly $template['body'] that has been already processed.

For QA: After being applied, filters generated content (multimedia, multimovie...), should be present in output. Now it isn't.

Ciao

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Done in 18_STABLE, 19_STABLE and HEAD. Now content introduced by filters isn't broken by the 2nd call to format_text()

Resolving as fixed. Ciao

Show
Eloy Lafuente (stronk7) added a comment - Done in 18_STABLE, 19_STABLE and HEAD. Now content introduced by filters isn't broken by the 2nd call to format_text() Resolving as fixed. Ciao

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: