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

Links to mht/mhtml files stream the MTHML file source code

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.6, 2.4.3
    • Fix Version/s: 2.3.7, 2.4.4
    • Component/s: Files API, SCORM
    • Labels:
    • Testing Instructions:
      Hide

      (Difficulty: easy, requires both administrator access, to update the instance, and teacher access to a course)

      Test fixture i.e. actions to be performed BEFORE applying the fix.

      1. Download the attached file Moodle_org open-source community-based tools for learning_org-.mht which represents the MHTML for https://moodle.org.
      2. Log into a Course, e.g. a Topics one, and Turn Editing on.
      3. Create a resource with this file e.g. DnD this file into a Topic.

      Test #1.

      1. Apply the patch according with your Moodle version (2.4 or 2.5)
      2. Log into the instance as an Administrator: the update stage will be launched.
      3. At the end of the update stage, enter into the Course above using Internet Explorer.
      4. Click on the file resource previously created: the resource will be loaded inline, replacing your Moodle instance with the view of the Home of Moodle.org site.

      Test #2.

      1. Create a new MTHML file browsing with Internet Explorer somewhere and save that page as .mht file.
      2. Log into a Course, e.g. a Topics one, and Turn Editing on.
      3. Create a resource with this new MHTML file e.g. DnD this file into a Topic.
      4. Click on this new resource: the resource will be loaded inline, replacing your Moodle instance with the view of the page site you've just saved.
      Show
      (Difficulty: easy, requires both administrator access, to update the instance, and teacher access to a course) Test fixture i.e. actions to be performed BEFORE applying the fix. Download the attached file Moodle_org open-source community-based tools for learning_org-.mht which represents the MHTML for https://moodle.org . Log into a Course, e.g. a Topics one, and Turn Editing on . Create a resource with this file e.g. DnD this file into a Topic. Test #1. Apply the patch according with your Moodle version ( 2.4 or 2.5 ) Log into the instance as an Administrator: the update stage will be launched. At the end of the update stage, enter into the Course above using Internet Explorer . Click on the file resource previously created: the resource will be loaded inline , replacing your Moodle instance with the view of the Home of Moodle.org site. Test #2. Create a new MTHML file browsing with Internet Explorer somewhere and save that page as .mht file. Log into a Course, e.g. a Topics one, and Turn Editing on . Create a resource with this new MHTML file e.g. DnD this file into a Topic. Click on this new resource: the resource will be loaded inline , replacing your Moodle instance with the view of the page site you've just saved.
    • Workaround:
      Hide

      Manually change the value of the mimetype column of each MHTML file as listed in the mdl_files table from document/unknown to message/rfc822, at least the ones in the filearea = 'content'.

      Show
      Manually change the value of the mimetype column of each MHTML file as listed in the mdl_files table from document/unknown to message/rfc822 , at least the ones in the filearea = 'content' .
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      m25_MDL-38468_Fix_MHTML_files_delivery

      Description

      See discussion at http://moodle.org/mod/forum/discuss.php?d=224274

      Moodle is not able to handle mht/mhtml links, for example within a SCORM package. When a user tries to open such a file in Internet Explorer, the source code is shown. Other browsers with appropriate extensions which are able to handle mht/mhtml files behave in the same way.

      This is especially an issue with Microsoft IT Academy packages. These packages contain several mht/mhtml links.

      Proposed fix:

      Edit lib/filelib.php.
      At about line 1505, between

      'mpg' => array ('type'=>'video/mpeg', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'),

      and

      'nbk' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),

      insert the following code:

      'mht' => array ('type'=>'message/rfc822', 'icon'=>'archive'),
      'mhtml' => array ('type'=>'message/rfc822', 'icon'=>'archive'),

      Save the file.
      If you already published a SCORM package, it is necessary to publish it again. Do so by editing the package and uploading the files again. Save the package and verify the fix with Internet Explorer.

      Thanks to all participants in the forum thread, especially to Matteo Scaramuccia.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    13/May/13