From 7e115b445fc7e6a2aebce33039c40b7b2b208ace Mon Sep 17 00:00:00 2001 From: neoan Date: Mon, 23 Jan 2023 20:30:41 -0500 Subject: [PATCH] Convert null to empty string in substitution to avoid deprecation error as of php8.1 --- Interpreter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Interpreter.php b/Interpreter.php index 2ec10c5..e7bdf18 100644 --- a/Interpreter.php +++ b/Interpreter.php @@ -252,7 +252,7 @@ private function replaceVariables(array $matches, string $content): string $lookFor = trim($pair[2]); $substitutes = $this->handleSubstitutions($lookFor); if(array_key_exists($lookFor, $this->flatData)){ - $content = str_replace($pair[0], $this->flatData[$lookFor], $content); + $content = str_replace($pair[0], $this->flatData[$lookFor] ?? '', $content); foreach ($substitutes as $substitute){ $content = str_replace($substitute[0], $substitute[1], $content); }