akeeba / com_datacompliance

A tool to help you work towards EU GDPR compliance for your Joomla!™ site
GNU General Public License v3.0
14 stars 5 forks source link

Update adoptChild to handle values with "special" characters #24

Closed mbabker closed 6 years ago

mbabker commented 6 years ago

Basically, the Export helper's adoptChild method runs into this scenario if you export data where a field has ampersands in the value (such as if you have a core Joomla user with the French help site saved as their preference, below is a full JSON string which triggers the issue).

{"admin_style":5,"admin_language":"en-GB","language":"en-GB","editor":"codemirror","helpsite":"https:\/\/help.joomla.fr\/index.php?option=com_help&keyref=Help{major}{minor}:{keyref}","timezone":"America\/Chicago"}
nikosdion commented 6 years ago

Good catch! Thank you very much!

nikosdion commented 6 years ago

This actually broke the data export completely. I am reverting it.

mbabker commented 6 years ago

Well, that sucks.

nikosdion commented 6 years ago

Don't worry though, I found the real root cause and how to properly fix it ;)

nikosdion commented 6 years ago

If you are wondering, your solution doesn't work when you are adding multiple nodes with the same name as was the case with data export. However, the root cause is not node adoption but node export. Values in added child nodes should have entities encoded. That was a simple solution, just in a different place.