Skip to content

Commit

Permalink
[FIX] label escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans Höchtl authored Jan 16, 2019
1 parent 125a758 commit 7815cd6
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Classes/Domain/Factory/FormDefinitionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getFromDefinitionByHubspotIdentifier(string $formIdentifier, Run
if (!empty($value['communicationConsentText'])) {
$fields[] = [
'name' => 'consent-communication-consent-text',
'label' => $value['communicationConsentText'],
'label' => htmlspecialchars($value['communicationConsentText']),
'type' => 'rte',
'fieldType' => 'rte',
'description' => '',
Expand All @@ -90,7 +90,7 @@ public function getFromDefinitionByHubspotIdentifier(string $formIdentifier, Run
foreach ($value['communicationConsentCheckboxes'] as $constentCheckBox) {
$fields[] = [
'name' => "consent-checkbox-{$constentCheckBox['communicationTypeId']}",
'label' => $constentCheckBox['label'],
'label' => htmlspecialchars($constentCheckBox['label']),
'type' => 'enumeration',
'fieldType' => 'booleancheckbox',
'description' => '',
Expand All @@ -99,7 +99,7 @@ public function getFromDefinitionByHubspotIdentifier(string $formIdentifier, Run
'options' => [
[
'value' => $constentCheckBox['communicationTypeId'],
'label' => $constentCheckBox['label'],
'label' => htmlspecialchars($constentCheckBox['label']),
],
],
'enabled' => 1,
Expand All @@ -111,7 +111,7 @@ public function getFromDefinitionByHubspotIdentifier(string $formIdentifier, Run
if (!empty($value['processingConsentText'])) {
$fields[] = [
'name' => 'consent-processing-consent-text',
'label' => $value['processingConsentText'],
'label' => htmlspecialchars($value['processingConsentText']),
'type' => 'rte',
'fieldType' => 'rte',
'description' => '',
Expand All @@ -131,7 +131,7 @@ public function getFromDefinitionByHubspotIdentifier(string $formIdentifier, Run
if (!empty($value['processingConsentCheckboxLabel'])) {
$fields[] = [
'name' => "consent-checkbox-checkbox-label}",
'label' => $value['processingConsentCheckboxLabel'],
'label' => htmlspecialchars($value['processingConsentCheckboxLabel']),
'type' => 'enumeration',
'fieldType' => 'booleancheckbox',
'description' => '',
Expand All @@ -151,7 +151,7 @@ public function getFromDefinitionByHubspotIdentifier(string $formIdentifier, Run
if (!empty($value['processingConsentFooterText'])) {
$fields[] = [
'name' => 'consent-processing-consent-footer-text',
'label' => $value['processingConsentFooterText'],
'label' => htmlspecialchars($value['processingConsentFooterText']),
'type' => 'rte',
'fieldType' => 'rte',
'description' => '',
Expand All @@ -166,7 +166,7 @@ public function getFromDefinitionByHubspotIdentifier(string $formIdentifier, Run
if (!empty($value['privacyPolicyText'])) {
$fields[] = [
'name' => 'consent-privacy-policy-text',
'label' => $value['privacyPolicyText'],
'label' => htmlspecialchars($value['privacyPolicyText']),
'type' => 'rte',
'fieldType' => 'rte',
'description' => '',
Expand All @@ -193,7 +193,7 @@ public function getFromDefinitionByHubspotIdentifier(string $formIdentifier, Run
$formDefinition['renderingOptions']['_fusionRuntime'] = $runtime;
$formDefinition['finishers'] = $this->finishers;
if (!empty($hubspotForm['submitText'])) {
$formDefinition['renderingOptions']['submitButtonLabel'] = $hubspotForm['submitText'];
$formDefinition['renderingOptions']['submitButtonLabel'] = htmlspecialchars($hubspotForm['submitText']);
}

return $formDefinition;
Expand All @@ -210,7 +210,7 @@ protected function getForm(string $identifier, string $label, array $children):
return [
'type' => 'Onedrop.Form.Hubspot:Component.Molecule.Form',
'identifier' => $identifier,
'label' => $label,
'label' => htmlspecialchars($label),
'renderables' => $children,
];
}
Expand Down Expand Up @@ -301,7 +301,7 @@ protected function renderField(array $definition): array
}
if (!empty($definition['options'])) {
foreach ($definition['options'] as $option) {
$properties['options'][$option['value']] = $option['label'];
$properties['options'][$option['value']] = htmlspecialchars($option['label']);
}
}

Expand Down Expand Up @@ -331,7 +331,7 @@ protected function renderField(array $definition): array
return [
'type' => $type,
'identifier' => !empty($definition['name']) ? $definition['name'] : md5(json_encode($definition)),
'label' => $definition['label'],
'label' => htmlspecialchars($definition['label']),
'validators' => $this->renderFieldValidators($definition),
'properties' => $properties,
'defaultValue' => $defaultValue,
Expand Down

0 comments on commit 7815cd6

Please sign in to comment.