From 9e5803cb8a86dd424c989977fd134dc0669e89b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Tournoy?= Date: Tue, 20 Aug 2024 16:59:31 +0200 Subject: [PATCH] Attempt to fix PHP Fatal error: Uncaught TypeError: htmlspecialchars(): Argument #1 ($string) must be of type string, array given CF issue https://github.com/seboettg/citeproc-php/issues/184 #184 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaƫl Tournoy --- src/Rendering/Text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rendering/Text.php b/src/Rendering/Text.php index f1ddbb8..d0137c9 100644 --- a/src/Rendering/Text.php +++ b/src/Rendering/Text.php @@ -236,7 +236,7 @@ private function renderVariable($data, $lang) } return $this->applyTextCase( StringHelper::clearApostrophes( - htmlspecialchars($value, ENT_HTML5) + htmlspecialchars(gettype($value) === "string" ? $value : implode($value, ';'), ENT_HTML5) ), $lang );