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

Unable to export files containing unicode characters in the name to portfolio

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.3
    • Portfolio
    • MOODLE_23_STABLE
      1. Create a glossary entry with an image in the description
      2. The image name has to contain unicode characters
      3. Export the entry to a portfolio e.g. file download
      4. Check that the file is exported

      1. Create a glossary entry with an image in the description
      2. The image name has to contain unicode characters
      3. Export the entry

      Expected

      • The file is exported

      Actual

      • An exception is raised because the file is not found

      This patch should solve the issue:

      diff --git a/lib/portfoliolib.php b/lib/portfoliolib.php
      index dc7473a..aa9d8b4 100644
      --- a/lib/portfoliolib.php
      +++ b/lib/portfoliolib.php
      @@ -1253,6 +1253,7 @@ function portfolio_rewrite_pluginfile_url_callback($contextid, $component, $file
               return $matches;
           }
           $filename = substr($attributes[$key], strpos($attributes[$key], '@@PLUGINFILE@@') + strlen('@@PLUGINFILE@@'));
      +    $filename = urldecode($filename);
           $filepath = '/';
           if (strpos($filename, '/') !== 0) {
               $bits = explode('/', $filename);

      Although, this does not solve UTF8 encoding in zip files: MDL-24928

            poltawski Dan Poltawski
            fred Frédéric Massart
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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