Skip to content
Snippets Groups Projects
Commit b7e34203 authored by André Buchmann's avatar André Buchmann Committed by Stefan Bürk
Browse files

[BUGFIX] Prevent double flexform xml2array parsing

Check the pi_flexform value of the request attribute
'currentContentObject' to be of type string before parsing with
GU::xml2array().

Resolves: #105195
Releases: main, 12.4
Change-Id: I915deeb89c39b4b90342da582b05acc98a7b86fd
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/86417


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarGarvin Hicking <gh@faktor-e.de>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarGarvin Hicking <gh@faktor-e.de>
parent f1c0767f
Branches
No related merge requests found
......@@ -91,8 +91,11 @@ class FormFrontendController extends ActionController
*/
protected function overrideByFlexFormSettings(array $formDefinition): array
{
$flexFormData = GeneralUtility::xml2array($this->request->getAttribute('currentContentObject')?->data['pi_flexform'] ?? '');
if (!is_array($flexFormData)) {
$flexFormData = $this->request->getAttribute('currentContentObject')?->data['pi_flexform'] ?? [];
if (is_string($flexFormData) && $flexFormData !== '') {
$flexFormData = GeneralUtility::xml2array($flexFormData);
}
if (!is_array($flexFormData) || $flexFormData === []) {
return $formDefinition;
}
if (isset($formDefinition['finishers'])) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment