Moodle
  1. Moodle
  2. MDL-4640

Forum attachment HTML should be passed through filter

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.3
    • Fix Version/s: None
    • Component/s: Forum
    • Labels:
      None
    • Environment:
      All
    • Affected Branches:
      MOODLE_15_STABLE
    • Rank:
      11185

      Description

      The download attachment links which are generated in forum posts should be passed through the filters, but they aren't. If they were, then an MP3 attachment (for example) could magically turn into a media player. Similar benefits for the new Jmol filter, and any filter that transforms a link.

      The principle is simply to add a couple of filter_text() calls inside the forum_print_attachments() function (in /mod/forum/lib.php). Below is the diff against 1.5.3+.

      2199c2199

      < $output .= <a href=\$ffurl\>$file</a><br />;

      > $output .= filter_text(<a href=\$ffurl\>$file</a><br />);

      2209c2209

      < echo <a href=\$ffurl\>$file</a><br />;

      > echo filter_text(<a href=\$ffurl\>$file</a><br />);

        Activity

        Hide
        Martin Dougiamas added a comment -

        From Martin Dougiamas (martin at moodle.com) Thursday, 16 March 2006, 04:41 PM:

        Yep, go for it Dan, thanks!

        From Dan Stowell (d.stowell at ucl.ac.uk) Thursday, 16 March 2006, 07:29 PM:

        OK, I've committed this.

        In the diff I originally pasted in, I seem to have added it in two places, but only the second is the one we want (i.e. only for printing the webpage, not for creating the HTML emails - since, as mentioned in the Moodle forum, it's polite not to include media players, applets etc in emails).

        Show
        Martin Dougiamas added a comment - From Martin Dougiamas (martin at moodle.com) Thursday, 16 March 2006, 04:41 PM: Yep, go for it Dan, thanks! From Dan Stowell (d.stowell at ucl.ac.uk) Thursday, 16 March 2006, 07:29 PM: OK, I've committed this. In the diff I originally pasted in, I seem to have added it in two places, but only the second is the one we want (i.e. only for printing the webpage, not for creating the HTML emails - since, as mentioned in the Moodle forum, it's polite not to include media players, applets etc in emails).

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: