[BUGFIX] Respect IRRE parent config in Ajax calls 83/51783/3
authorHelmut Hummel <typo3@helhum.io>
Sat, 25 Feb 2017 19:32:39 +0000 (20:32 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sun, 26 Feb 2017 18:56:22 +0000 (19:56 +0100)
commit4f3bdadd0269b27f20b4fca224156d8584d6ecfd
tree316bcc90ebd285558d764248988c7f3c21fd2ad8
parentd0c809165c44166da9188a9c5f498549c61716ba
[BUGFIX] Respect IRRE parent config in Ajax calls

The code to transfer the inline parent context to form engine
in Ajax requests exists but is currently non functional in some
situations.

The config is stored as array, which is hashed by serializing
the array, and building the hash on that string. However
that string is not transferred over the wire,
but the json encoded array.

If a float value was present at some place in this array,
json_encode and json_decode will add a slight offset
to these numbers than if the value is serialized.

To avoid such errors, the hmac is now calculated and
checked against the json encoded value.

We also clean up the code in this area to avoid duplication
and improve the hash calculation and comparison.

By doing so, we can clean up and simplify the flex form handling
for IRRE fields as well.

Resolves: #79999
Releases: master
Change-Id: I049d699f9f30edad0a9c8b06bbc3970e2cdac417
Reviewed-on: https://review.typo3.org/51783
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Classes/Controller/FormInlineAjaxController.php
typo3/sysext/backend/Classes/Form/Container/InlineControlContainer.php
typo3/sysext/backend/Classes/Form/InlineStackProcessor.php