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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.3
    • Fix Version/s: None
    • Component/s: Portfolio
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_23_STABLE

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              poltawski Dan Poltawski
              Reporter:
              fred Frédéric Massart
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: