nextcloud / forms

📝 Simple form & survey app for Nextcloud
https://apps.nextcloud.com/apps/forms
GNU Affero General Public License v3.0
325 stars 98 forks source link

The Forms folder structure is not sanitized which can lead to synchronization issues when uploading files #2409

Open stefan0xC opened 2 days ago

stefan0xC commented 2 days ago

Please use the 👍 reaction to show that you are affected by the same issue. Please don't comment if you have no relevant information to add!

Describe the bug Uploaded files are seemingly saved in a folder structure Forms/{id of form} - {title of form}/{id of submission}/{id of question} - {title of question} but the titles do not seem to get trimmed in regards to trailing white spaces, which results in syncing problems (at least on Windows 11 with NTFS).

To Reproduce Steps to reproduce the behavior:

  1. Go to Forms and create a new form
  2. Call it test with a trailing whitespace
  3. Add a file upload option and call it test as well
  4. Upload a file

Expected behavior I expect the fields that are used for filenames to be trimmed in regard to whitespace and maybe also sanitized regarding other invalid characters like :

Screenshots If applicable, add screenshots to help explain your problem. Image

Nextcloud (please complete the following information):

Desktop (please complete the following information):

Chartman123 commented 2 days ago

@Koc one more bug related to the file question type. I also had a similar issue with a : in the question title. So we should remove all offending characters from the folder names.