From 52954998c5daa233d13904b056030e19e20b24a1 Mon Sep 17 00:00:00 2001 From: Jisse Reitsma Date: Mon, 1 Jul 2024 12:10:34 +0200 Subject: [PATCH] Type Error in class AddCspInlineScripts with the Hyva Checkout #237 --- CHANGELOG.md | 4 ++++ Plugin/AddCspInlineScripts.php | 6 +++++- composer.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d170c88..49a2104 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [3.9.1] - 1 July 2024 +### Fixed +- Type Error in class AddCspInlineScripts with the Hyva Checkout #237 + ## [3.9.0] - 20 June 2024 ### Added - Added $secureRenderer, so CSP compliance #231 @jemoon @hostep @nige-one diff --git a/Plugin/AddCspInlineScripts.php b/Plugin/AddCspInlineScripts.php index 90ee583..528a843 100644 --- a/Plugin/AddCspInlineScripts.php +++ b/Plugin/AddCspInlineScripts.php @@ -19,8 +19,12 @@ public function __construct( $this->secureHtmlRendererStub = $secureHtmlRendererStub; } - public function afterToHtml(Template $block, string $html): string + public function afterToHtml(Template $block, $html): string { + if (empty($html)) { + return ''; + } + if (false === strstr((string)$block->getNameInLayout(), 'yireo_googletagmanager2.')) { return $html; } diff --git a/composer.json b/composer.json index a150f6f..eb5aa6a 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "yireo/magento2-googletagmanager2", - "version": "3.9.0", + "version": "3.9.1", "license": "OSL-3.0", "type": "magento2-module", "homepage": "https://www.yireo.com/software/magento-extensions/googletagmanager2",