Skip to content

Commit 591a815

Browse files
author
Timi-Artturi Mäkelä
committed
Automatic conversion of false to array is deprecated hotfix
1 parent 2619651 commit 591a815

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
[unreleased]
8+
9+
[php-81-automatic-conversion-hotfix]
10+
### Fixed
11+
- Fixes "Automatic conversion of false to array is deprecated" on Dust.php
12+
13+
[released]
714
## [1.38.1]
815

916
### Fixed

src/Renderer/Dust.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ public function __construct( string $template ) {
7373
public function render( array $fields ) : string {
7474
$compiled = self::$dust->compileFile( $this->template );
7575

76+
// In same cases this might be false.
77+
// We need to set key as an array after PHP 8.1 in these situations.
78+
if ( empty( $fields['data'] ) ) {
79+
$fields['data'] = [];
80+
}
81+
7682
// Pass on the block data
7783
$fields['data']['block'] = $fields['block'];
7884

0 commit comments

Comments
 (0)