Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Special characters in filename lead to no downloadable file #57

Closed
univietw opened this issue Oct 25, 2021 · 0 comments · Fixed by #58
Closed

Special characters in filename lead to no downloadable file #57

univietw opened this issue Oct 25, 2021 · 0 comments · Fixed by #58

Comments

@univietw
Copy link
Contributor

How to reproduce:

  • Upload a file with a "?" in it's filename in a new activity
  • click on "download"
    you get an error like this
    error

What I found out:

  1. It seems like your plugin is using some old columns but I couldn't find them in the db/install.xml anymore. I'd encourage you to at least add this column to the install.xml so you don't get some not helpful db-Errors while debugging
  2. the Filename is not encoded. This leads to the following procedure:
    pluginfile.php/${number}/mod_pdfannotator/content/0/iseverybodythere?.pdf?forcedownload=1
    the browser interpretates the first "?" as the end of the url and the .pdf as the first parameter

I will push a pull request to fix this issue. This probably also applies to all other http special characters like "&" or "(", but I have not tested it.

Problem 1) is still not fixed by me because I have no idea whatsoever if this code is still needed or how to fix it. (see lib.php:386-395)

univietw added a commit to univietw/moodle-mod_pdfannotator that referenced this issue Oct 25, 2021
Friederike-cil added a commit that referenced this issue Oct 28, 2021
fix #57: file encoding problems
Friederike-cil pushed a commit that referenced this issue Nov 2, 2021
Friederike-cil pushed a commit that referenced this issue Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant