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

Should be a way to control filtering on/off for individual file or resource

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 1.9.3, 2.0
    • Filters
    • None
    • MOODLE_19_STABLE, MOODLE_20_STABLE

      One of our courses is teaching HTML and they object to their HTML example files being messed with. Moodle adds stylesheet links in there because it is set to run filters on HTML files ($CFG->filteruploadedfiles=1). Unfortunately we need the setting on for other courses.

      My trivial solution is the following one-liner:

      Index: file.php
      ===================================================================
      RCS file: /home/cvs_repositories/globalcvs/ou-moodle/file.php,v
      retrieving revision 1.19.4.1
      diff -u -r1.19.4.1 file.php
      — file.php 30 Oct 2008 11:20:37 -0000 1.19.4.1
      +++ file.php 6 Nov 2008 16:18:47 -0000
      @@ -266,8 +266,14 @@
      // ========================================
      session_write_close(); // unlock session during fileserving
      $filename = $args[count($args)-1];

      • send_file($pathname, $filename, $lifetime, $CFG->filteruploadedfiles, false, $forcedownload);
        + send_file($pathname, $filename, $lifetime,
        + optional_param('preventfilter',0,PARAM_INT) ? 0 : $CFG->filteruploadedfiles,
        + false, $forcedownload);

      function not_found($courseid) {
      global $CFG;
      header('HTTP/1.0 404 not found');

      As you can see this just lets people do ?preventfilter=1 on a file.php request.

      There may well be better ways to achieve this objective, especially with regard to Petr's file handling changes for 2.0, so I am not necessarily suggesting this patch should be committed, just pointing out this (minor) issue.

            timhunt Tim Hunt
            quen Sam Marshall
            Nobody Nobody
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.