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

Chrome cannot download files when the filename in Content-Disposition contains a comma (e.g. quiz report download)

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MDL-73624-master
    • Hide

      1. Create a quiz that contains a comma in the name
      2. Submit an attempt
      3. Visit the Quiz report view
      4. Click 'Download attempts as CSV'
      5. Confirm downloading the file is successful

      Show
      1. Create a quiz that contains a comma in the name 2. Submit an attempt 3. Visit the Quiz report view 4. Click 'Download attempts as CSV' 5. Confirm downloading the file is successful
    • 0
    • Team Hedgehog 4.1 pre 1.1, Team Hedgehog Sprint 1.1

      If a quiz name contains commas, the attempts export (report/overview) fails for csv/xls format with an error ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION. Applies only to Chrome browser.

      Commas are not escaped properly within the quiz overview report, but it might actually concern the csv export tool.

      Test instructions:

      • Create a quiz that contains comma in the name
      • Submit an attempt
      • Visit Quiz report view
      • Click 'Download attempts as CSV'
      • Get the mentioned error

      Dirty fix:
      L74 mod/quiz/report/overview/report.php

      add str_replace to remove commas:

      $table->is_downloading($options->download, str_replace(',', '', $filename),
      $courseshortname . ' ' . format_string($quiz->name, true));

            meirza.arson@moodle.com Meirza
            pavel.m.sokolov Pavel Sokolov
            David Woloszyn David Woloszyn
            Andrew Lyons Andrew Lyons
            John Edward Pedregosa John Edward Pedregosa
            Votes:
            26 Vote for this issue
            Watchers:
            33 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 53 minutes
                5h 53m

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