Skip to content

Commit

Permalink
fix #57: file encoding problems
Browse files Browse the repository at this point in the history
  • Loading branch information
univietw authored and Friederike-cil committed Oct 28, 2021
1 parent b303c2a commit 8db7111
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion classes/output/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __construct($pdfannotator, $capabilities, $file) {
$component = $file->get_component();
$filearea = $file->get_filearea();
$itemid = $file->get_itemid();
$filename = $file->get_filename();
$filename = urlencode($file->get_filename());

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

Expand Down
2 changes: 1 addition & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ function pdfannotator_pluginfile($course, $cm, $context, $filearea, $args, $forc
array_shift($args); // Ignore revision - designed to prevent caching problems only.

$fs = get_file_storage();
$relativepath = implode('/', $args);
$relativepath = urldecode(implode('/', $args));
$fullpath = rtrim("/$context->id/mod_pdfannotator/$filearea/0/$relativepath", '/');
do {
if (!$file = $fs->get_file_by_hash(sha1($fullpath))) {
Expand Down
2 changes: 0 additions & 2 deletions shared/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8db7111

Please sign in to comment.