diff --git a/source/php/Component/Acceptance/Acceptance.php b/source/php/Component/Acceptance/Acceptance.php index 1bd34639..9731ef81 100644 --- a/source/php/Component/Acceptance/Acceptance.php +++ b/source/php/Component/Acceptance/Acceptance.php @@ -51,27 +51,28 @@ public function init() } if (!empty($this->data['labels'])) { - $json = json_decode($this->data['labels']); + $knownLabels = json_encode($this->data['labels']['knownLabels']); + $unknownLabels = json_encode($this->data['labels']['unknownLabels']); - if (isset($json->infoLabel)) { - $this->data['infoLabel'] = $json->infoLabel; + if (isset($this->data['labels']->infoLabel)) { + $this->data['infoLabel'] = $this->data['labels']->infoLabel; } if (!empty($this->data['supplierPolicy'])) { - $json->knownLabels->info = str_replace( + $knownLabels = str_replace( array('{SUPPLIER_WEBSITE}', '{SUPPLIER_POLICY}'), array($this->data['supplierName'], $this->data['supplierPolicy']), - $json->knownLabels->info ?? '' + $knownLabels ); - $this->data['labels'] = $json->knownLabels ?? ''; + $this->data['labels'] = json_decode($knownLabels); } else { - $json->unknownLabels->info = str_replace( + $unknownLabels = str_replace( '{SUPPLIER_WEBSITE}', $this->data['supplierHost'], - $json->unknownLabels->info ?? '' + $unknownLabels ); - $this->data['labels'] = $json->unknownLabels; + $this->data['labels'] = json_decode($unknownLabels); } } @@ -249,4 +250,4 @@ public function __construct( $this->requiresAccept = $requiresAccept; $this->systemType = $systemType; } -} +} \ No newline at end of file diff --git a/source/php/Component/Iframe/Iframe.php b/source/php/Component/Iframe/Iframe.php index 0b921c2b..693c1437 100644 --- a/source/php/Component/Iframe/Iframe.php +++ b/source/php/Component/Iframe/Iframe.php @@ -40,7 +40,7 @@ public function init() } if (isset($labels)) { - $this->data['labels'] = json_encode($labels); + $this->data['labels'] = $labels; } if(!empty($poster)) {