From 9350acd02b63ed83c0bec135f6082b83bc23d899 Mon Sep 17 00:00:00 2001 From: Sophie Brunner <95913912+sophiebrunner@users.noreply.github.com> Date: Wed, 2 Oct 2024 10:45:27 +0200 Subject: [PATCH] [Bugfix] pruefe auf not null bevor trim() aufgerufen wird. (#5) Co-authored-by: Sophie Brunner --- Classes/ViewHelpers/Script/WriteViewHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/ViewHelpers/Script/WriteViewHelper.php b/Classes/ViewHelpers/Script/WriteViewHelper.php index f5392c2..f42a7db 100644 --- a/Classes/ViewHelpers/Script/WriteViewHelper.php +++ b/Classes/ViewHelpers/Script/WriteViewHelper.php @@ -101,7 +101,7 @@ public function render(): string return ''; } - $condition = trim($this->arguments['condition']); + $condition = isset($this->arguments['condition']) ? trim($this->arguments['condition']) : ''; $condition = strlen($condition) ? "if($condition)" : ''; $this->tag->setContent($condition . 'document.write(\'' . addcslashes($html, "'") . '\')');