Bug #64914

Cleaner scripts crashes due to incomplete flexform content

Added by Jose Antonio Guerra almost 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2015-02-06
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Stabilization Sprint

Description

When the DS have more fields described than the actual FlexForm content the check crashes:

PHP error: Illegal string offset
Where: typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php, around line 230

The method \TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::traverseFlexFormXMLData_recurse fails to check parameters before calling itself recursively therefore crashing the script.

This bug is related to #17237 and #18472 but in this case there's no malformed XML triggering the failure.


Related issues

Related to TYPO3 Core - Bug #17237: Fatal error: Cannot use string offset as an array in C:\xampp\htdocs\dev\TYPO\dummy\t3lib\class.t3lib_flexformtools.php on line Closed 2007-04-24
Related to TYPO3 Core - Bug #18472: Cleaner scripts crash with errors due to malformed flexform content Closed 2008-03-18
Related to TYPO3 Core - Bug #68160: Warning in FlexFormTools.php since typo 6.2.10 Closed 2015-07-15

Associated revisions

Revision 5985cf81 (diff)
Added by Jose Antonio Guerra almost 5 years ago

[BUGFIX] Cleaner scripts crashes due to incomplete flexform content

Failure to check arguments used on recursive function call
causes PHP runtime error.

Resolves: #64914
Releases: master, 6.2
Change-Id: Id61ae9961415ab5d9d4294b224c90f2e02df6f14
Reviewed-on: http://review.typo3.org/36720
Reviewed-by: Mathias Schreiber <>
Tested-by: Mathias Schreiber <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 8d844421 (diff)
Added by Jose Antonio Guerra almost 5 years ago

[BUGFIX] Cleaner scripts crashes due to incomplete flexform content

Failure to check arguments used on recursive function call
causes PHP runtime error.

Resolves: #64914
Releases: master, 6.2
Change-Id: Id61ae9961415ab5d9d4294b224c90f2e02df6f14
Reviewed-on: http://review.typo3.org/36722
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#1 Updated by Christian Kuhn almost 5 years ago

  • Sprint Focus set to Stabilization Sprint

#2 Updated by Gerrit Code Review almost 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36720

#3 Updated by Gerrit Code Review almost 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36720

#4 Updated by Gerrit Code Review almost 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36720

#5 Updated by Gerrit Code Review almost 5 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36720

#6 Updated by Gerrit Code Review almost 5 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36722

#7 Updated by Gerrit Code Review almost 5 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36722

#8 Updated by Jose Antonio Guerra almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#9 Updated by Jo Hasenau over 4 years ago

According to a clients information the import of the l10nmgr is broken with 6.2.10 and I tracked it down to this change

The problem is the new behavour in line 225 of FlexFormTools.php
The old version handed over $this as reference, the new one puts it into an array.

Results in

PHP Warning: 
Parameter 5 to tx_l10nmgr_tools::translationDetails_flexFormCallBackForOverlay()
expected to be a reference, value given in 
/domains/typo3_src/typo3_src-6.2.10/typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php line 242

#10 Updated by Jose Antonio Guerra over 4 years ago

Jo Hasenau wrote:

According to a clients information the import of the l10nmgr is broken with 6.2.10 and I tracked it down to this change

The problem is the new behavour in line 225 of FlexFormTools.php
The old version handed over $this as reference, the new one puts it into an array.

Results in
[...]

Which PHP version are you using? Seems not being consistent through recent versions...

The problem seems to be that "call_user_func_array" does not honor the destination function signature so parameters are always passed by value. The extra function was introduced to be able to add unit testing to the patch but this is indeed a nasty side effect.

(see http://php.net/manual/en/function.call-user-func-array.php#refsect1-function.call-user-func-array-notes)

In the meanwhile you may replace the calls to "$this->executeCallBackMethod" with the former method or changing the receiving function so it expects its 5th parameter to be passed by value (changing "&$param" to "$param")

#11 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF