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

Customfield textarea file serving bug

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Development in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7.5, 3.7.7, 3.8.2, 3.8.4, 3.9, 3.9.1
    • Fix Version/s: None
    • Component/s: Other

      Description

      Customfield textarea lib.php file implements  function custofield_textarea_pluginfile. In this function file is served by calling send_file function with wrong params. This causes that served file name is always 86400.

      Function call in customfield/field/textarea/lib.php looks like this:

      send_file($file, 86400, 0, $forcedownload, $options);

      Actual send_file function expects such params:

      function send_file($path, $filename, $lifetime = null , $filter=0, $pathisstring=false, $forcedownload=false, $mimetype='',
      $dontdie=false, array $options = array())

      Function call in customfield/field/textarea/lib.php should be:

      send_file($file, $filename, 86400, 0, false, $forcedownload, '', false, $options);

        Attachments

          Activity

            People

            Assignee:
            peter.spicer Peter Spicer
            Reporter:
            avegys Andrius
            Peer reviewer:
            Peter Dias
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 56 minutes
                56m