Sterc / FormIt

A dynamic form processing Snippet for MODX Revolution
https://docs.modx.com/current/en/extras/formit
33 stars 58 forks source link

Encrypting the name of the file #167

Closed wax100 closed 6 years ago

joeke commented 6 years ago

Hi Yana, Encrypting of the filenames works well, except I found some more issues:

  1. When setting storeAttachments FormIt parameter to 0, or removing the parameter, the files array is still stored in the DB.
  2. It does not work well when using in combination with formEncrypt FormIt parameter set to 1, I get corrupted encrypted data in the FormIt CMP. As you can see in the code here: https://github.com/wax100/FormIt/blob/develop/core/components/formit/src/FormIt/Hook/Saveform.php#L155-L164, when using formEncrypt the full values json array is encrypted, and the storeAttachment / files should be part of that json array before it is encrypted.
wax100 commented 6 years ago

Morning, Joeke! I made 2 fix and now it should work correct with storeAttachments 0 And also with formEncrypt = 1

joeke commented 6 years ago

@wax100 I've tested it, and everything is working as expected. Thank you!

wax100 commented 6 years ago

@joeke Nice to hear ! =)