[BUGFIX] EM 6.0 parse configuration type 'options' correctly
[Packages/TYPO3.CMS.git] / typo3 / sysext / extensionmanager / Classes / Domain / Repository / ConfigurationItemRepository.php
index e1e2834..67fbd19 100644 (file)
@@ -127,13 +127,17 @@ class ConfigurationItemRepository {
         * @return array
         */
        protected function extractInformationForConfigFieldsOfTypeOptions(array $configurationOption) {
-               preg_match('/options\\[(.*)\\]/is', $configurationOption['type'], $typeMatches);
-               preg_match('/options\\[(.*)\\]/is', $configurationOption['label'], $labelMatches);
-               $optionValues = explode(',', $typeMatches[1]);
-               $optionLabels = explode(',', $labelMatches[1]);
-               $configurationOption['generic'] = $labelMatches ? array_combine($optionLabels, $optionValues) : array_combine($optionValues, $optionValues);
+               preg_match('/options\[(.*)\]/is', $configurationOption['type'], $typeMatches);
+               $optionItems = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $typeMatches[1]);
+               foreach ($optionItems as $optionItem) {
+                       $optionPair = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('=', $optionItem);
+                       if (count($optionPair) === 2) {
+                               $configurationOption['generic'][$optionPair[0]] = $optionPair[1];
+                       } else {
+                               $configurationOption['generic'][$optionPair[0]] = $optionPair[0];
+                       }
+               }
                $configurationOption['type'] = 'options';
-               $configurationOption['label'] = str_replace($labelMatches[0], '', $configurationOption['label']);
                return $configurationOption;
        }