Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-4640

Forum attachment HTML should be passed through filter

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

      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 />);

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: