From 0a857d7f881750d2754ca85be7b171a9e70cd6df Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Wed, 21 Jun 2023 13:22:08 +0200 Subject: [PATCH] fix(textfield): exception while displaying counters text field with a null value cannot be HTML encoded --- inc/field/textfield.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/field/textfield.class.php b/inc/field/textfield.class.php index 047f8b154..044c6c0ee 100644 --- a/inc/field/textfield.class.php +++ b/inc/field/textfield.class.php @@ -108,7 +108,7 @@ public function getValueForDesign(): string { } public function getValueForTargetText($domain, $richText): ?string { - return Sanitizer::encodeHtmlSpecialChars($this->value); + return Sanitizer::encodeHtmlSpecialChars($this->value ?? ''); } public function moveUploads() {