contao/import — Issue #2603: eval->encrypt inside Widget class
Author: aschempp
Created: 2011-11-29 19:50:47+00:00
State: open
Labels: Feature, framework

Today I noticed the PersonalData and Registration modules do not support encrypted fields. This is because only DataContainer takes care of encrypting and decrypting values.
However, in my opinion, the encryption should be handled by the widget class. Decrypt "incoming" values and encrypt "outgoing".

I have successfully tested this on custom member fields being encrypted on-the-fly. The en-/decryption has been moved from DataContainer.php to Widget.php (therefor 2 patches)
I also needed to patch the Encryption library to support arrays. The inline documentation already did say "mixed" input, but only string was supported.

I also noticed most of the backend widgets (but none of the frontend widgets) have a custom __set() handling for "value" to deserialize (potential) arrays. To make my patches work, this should be removed. Deserializing is also done in the parent Widget.php class on all values (I don't see a reason why not...).

[Download the attachments](http://www.contao.org/tl_files/tickets/2603.zip "Download the attachments of this ticket")

--- _Originally created on October 8th, 2010, at 11:30am (ID 2603)_