Skip to content

Commit

Permalink
Convert null to empty string in substitution to avoid deprecation err…
Browse files Browse the repository at this point in the history
…or as of php8.1
  • Loading branch information
sroehrl committed Jan 24, 2023
1 parent 7538a79 commit 7e115b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Interpreter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 7e115b4

Please sign in to comment.