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

Run *.xhtml file through the text filters.

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.7.2, 2.6.4, 2.7
    • 2.9
    • Filters, Resource
    • All
    • MOODLE_17_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • MOODLE_29_STABLE
    • MDL9443_Filter_XHTML_files.2014-11-19
    • Hide

      Pre-requisites

      1. Download the attached test_send_file.php file and place it at the root of the instance
      2. Enable the filter "Activity names auto-linking"
      3. Create a new course and add an activity named LINKED_ACTIVITY
        • Note down the ID of the course
      4. Create 3 files (a.html, a.xhtml, a.txt) with the following content:

        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <head>
            <title>No title here...</title>
        </head>
        <body>
          Link to LINKED_ACTIVITY.
        </body>
        </html>
        

      5. Create a new file system repository in which you add those 3 files
      6. In the new course, create a file resource for each file
        • Set "Use filters on file content" to "None"
        • Set the display option to embed

      Test 1

      Testing send_stored_file()

      1. View each of the file resources
        • The content of the files should not have changed
      2. Change each file resources' filter option to All files
      3. View each of the file resources
        • All should link to the activity named LINKED_ACTIVITY
      4. Change each file resources' filter option to HTML files only
      5. View each of the file resources
        • The file resources containing the .html and .xhtml files should link to the activity named LINKED_ACTIVITY
        • The file resource containing the .txt file should not link to the activity named LINKED_ACTIVITY

      Test 2

      Testing send_file()

      1. Access the file test_send_file.php with ?courseid=COURSEID&ext=txt&filter=0
      2. Change the arguments one by one to all the combinations of:
        • ext: txt, html, xhtml
        • filter: 0, 1, 2
      3. Make sure that:
        • The txt ext only links to LINKED_ACTIVITY only with filter: 1
        • The html ext links to LINKED_ACTIVITY with filters: 1 and 2
        • The xhtml ext links to LINKED_ACTIVITY with filters: 1 and 2
      Show
      Pre-requisites Download the attached test_send_file.php file and place it at the root of the instance Enable the filter "Activity names auto-linking" Create a new course and add an activity named LINKED_ACTIVITY Note down the ID of the course Create 3 files (a.html, a.xhtml, a.txt) with the following content: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>No title here...</title> </head> <body> Link to LINKED_ACTIVITY. </body> </html> Create a new file system repository in which you add those 3 files In the new course, create a file resource for each file Set "Use filters on file content" to "None" Set the display option to embed Test 1 Testing send_stored_file() View each of the file resources The content of the files should not have changed Change each file resources' filter option to All files View each of the file resources All should link to the activity named LINKED_ACTIVITY Change each file resources' filter option to HTML files only View each of the file resources The file resources containing the .html and .xhtml files should link to the activity named LINKED_ACTIVITY The file resource containing the .txt file should not link to the activity named LINKED_ACTIVITY Test 2 Testing send_file() Access the file test_send_file.php with ?courseid=COURSEID&ext=txt&filter=0 Change the arguments one by one to all the combinations of: ext: txt, html, xhtml filter: 0, 1, 2 Make sure that: The txt ext only links to LINKED_ACTIVITY only with filter: 1 The html ext links to LINKED_ACTIVITY with filters: 1 and 2 The xhtml ext links to LINKED_ACTIVITY with filters: 1 and 2
    • BACKEND Sprint 18

    Description

      It should be possible to fun filters on XHTML files ("application/xhtml+xml" mime type, with extension ".xhtml").

      If there is concern about users depending on the existing non-filtering behaviour, a setting could be used to disable it by default.

      Attachments

        Activity

          People

            balchd Dave Balch
            balchd Dave Balch
            Frédéric Massart Frédéric Massart
            Dan Poltawski Dan Poltawski
            Adrian Greeve Adrian Greeve
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11/May/15