Support #13410
closedGroup Library Add item with special characters in title
0%
Description
On Zendesk we had a case of a member trying to add a pdf with a special character in its title (for example: "Assignment # 2") and the upload created an empty file. Could/should we sanitize this behind the scenes?
Files
Updated by Boone Gorges about 4 years ago
- Status changed from New to Reporter Feedback
Could you please spell out the steps to reproduce in a bit more detail? I assume this means that 'Assignment #2' is the text entered in the Title field, not that 'Assignment #2' is the filename of the PDF?
Updated by scott voth about 4 years ago
The name of the actual file was "Assignment #2.pdf"
Updated by scott voth about 4 years ago
This might help. See attached
Updated by Boone Gorges about 4 years ago
- Target version set to 1.17.5
Thanks, Scott.
Putting the pieces together, it appears that this is a problem specific to the #
character. The Group Library Vue application uses #
for route navigation, and the presence of this character in group document URLs (format ?get_group_doc=123/assignment#2.pdf) was confusing the routing logic. The immediate problem is to URL-encode document URIs when building file links displayed in the Vue app, but this requires additional changes to our bp-group-documents customizations to ensure that the URL-encoded documents are decoded when you attempt to download the document. I've made these changes in https://github.com/cuny-academic-commons/cac/commit/7002974d6975298b227e4a72c961afe5255ed7a7 and deployed to the production site.
I tried to verify by checking the library at https://commons.gc.cuny.edu/groups/seeing-thinking-and-writing-ethnographically/library/#/ - the link I got from your screenshot - but it looks like the user renamed the files. Perhaps you could verify the behavior yourself, or ask the reporter to test the fix.
Updated by scott voth about 4 years ago
Thanks Boone - I tested it with her original file and it is working fine now.
Updated by Boone Gorges about 4 years ago
- Status changed from Reporter Feedback to Resolved
Great, thanks!