[BUGFIX] FlexFormNoTabsContainer: Fix usage of array_pop() 90/51590/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 8 Feb 2017 16:52:25 +0000 (17:52 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 15 Feb 2017 12:20:54 +0000 (13:20 +0100)
PHP’s `array_pop()` requires its argument being passed as reference,
but the result of `array_keys()` is directly used.
The result of `array_keys()` is now stored into a variable which gets
passed to `array_pop()`.

Resolves: #79686
Releases: master, 7.6
Change-Id: Icda3040abefbffad64e93acf0d7ae632ccee00bf
Reviewed-on: https://review.typo3.org/51590
Reviewed-by: Armin Vieweg <armin@v.ieweg.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>

index 7d3c021..bdaabe7 100644 (file)
@@ -41,7 +41,8 @@ class FlexFormNoTabsContainer extends AbstractContainer
         $resultArray = $this->initializeResultArray();
         // Determine this single sheet name, most often it ends up with sDEF, except if only one sheet was defined
-        $sheetName = array_pop(array_keys($flexFormDataStructureArray['sheets']));
+        $flexFormSheetNames = array_keys($flexFormDataStructureArray['sheets']);
+        $sheetName = array_pop($flexFormSheetNames);
         $flexFormRowDataSubPart = $flexFormRowData['data'][$sheetName]['lDEF'] ?: [];
         // That was taken from GeneralUtility::resolveSheetDefInDS - no idea if it is important