diff --git a/public/typo3conf/ext/ep_theme/Classes/Form/BpnApiFinisher.php b/public/typo3conf/ext/ep_theme/Classes/Form/BpnApiFinisher.php index 7f5cf3bf..4b7cea0b 100644 --- a/public/typo3conf/ext/ep_theme/Classes/Form/BpnApiFinisher.php +++ b/public/typo3conf/ext/ep_theme/Classes/Form/BpnApiFinisher.php @@ -23,16 +23,31 @@ class BpnApiFinisher extends AbstractFinisher protected function executeInternal() { - $values = []; - $formValues = $this->finisherContext->getFormValues(); - $mappingOption = $this->parseOption('mapping'); - $mappings = GeneralUtility::trimExplode(',', $mappingOption, true); - foreach ($mappings as $mapping) { - [$remote, $local] = GeneralUtility::trimExplode(':', $mapping); - $values[$remote] = $formValues[$local]; - } - if (count($values) > 0) { - $this->apiClient->registerAddress($values); + try { + $values = []; + $formValues = $this->finisherContext->getFormValues(); + $mappingOption = (string)$this->parseOption('mapping'); + $mappings = GeneralUtility::trimExplode(',', $mappingOption, true); + + foreach ($mappings as $mapping) { + $parts = GeneralUtility::trimExplode(':', $mapping, true, 2); + if (2 !== count($parts)) { + continue; + } + + [$remote, $local] = $parts; + if ('' === $remote || '' === $local || false === array_key_exists($local, $formValues)) { + continue; + } + + $values[$remote] = $formValues[$local]; + } + + if ([] !== $values) { + $this->apiClient->registerAddress($values); + } + } catch (\Throwable $e) { + // Intentionally ignore all errors so the form submission stays silent. } } }