Skip to content

Commit dd7a0ed

Browse files
Merge pull request #58 from univietw/57_fix
fix #57: file encoding problems
2 parents 4ebc49a + 86c285c commit dd7a0ed

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

classes/output/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct($pdfannotator, $capabilities, $file) {
6060
$component = $file->get_component();
6161
$filearea = $file->get_filearea();
6262
$itemid = $file->get_itemid();
63-
$filename = $file->get_filename();
63+
$filename = urlencode($file->get_filename());
6464

6565
$this->printurl = "$CFG->wwwroot/pluginfile.php/$contextid/$component/$filearea/$itemid/$filename?forcedownload=1";
6666

lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ function pdfannotator_pluginfile($course, $cm, $context, $filearea, $args, $forc
368368
array_shift($args); // Ignore revision - designed to prevent caching problems only.
369369

370370
$fs = get_file_storage();
371-
$relativepath = implode('/', $args);
371+
$relativepath = urldecode(implode('/', $args));
372372
$fullpath = rtrim("/$context->id/mod_pdfannotator/$filearea/0/$relativepath", '/');
373373
do {
374374
if (!$file = $fs->get_file_by_hash(sha1($fullpath))) {

shared/index.js

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)