Skip to content

Commit

Permalink
Prevent null HTML from causing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jissereitsma committed Oct 2, 2024
1 parent 91bd23c commit 2ce6b63
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.1.1] - 2 October 2024
### Fixed
- Prevent null HTML from causing errors

## [0.1.0] - 4 September 2024
### Added
- New default mode `custom` to only allow blocks that are explicitly whitelisted
Expand Down
2 changes: 1 addition & 1 deletion Plugin/AddCspInlineScripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(
public function afterToHtml(Template $block, $html): string
{
if (false === $this->allowBlock->allow($block)) {
return $html;
return (string)$html;
}

if (true === $this->config->logging()) {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yireo/magento2-csp-whitelist-inline-js",
"version": "0.1.0",
"version": "0.1.1",
"description": "Magento module to automatically add inline JS script to CSP whitelist",
"type": "magento2-module",
"require": {
Expand Down

0 comments on commit 2ce6b63

Please sign in to comment.