Skip to content

Commit 86c710a

Browse files
authored
Don't pass null to string functions for PHP 8.1
1 parent 74ec0eb commit 86c710a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Images.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public function imagesParse($column = null, $index = null, $array = false)
2828
$image = explode('|', $image, 2);
2929
$array[] = [
3030
'file' => trim($image[0]),
31-
'caption' => trim($image[1] ?? null),
32-
'autocaption' => trim($image[1] ?? null) ?: pathinfo($image[0])['filename'],
31+
'caption' => trim($image[1] ?? ''),
32+
'autocaption' => trim($image[1] ?? '') ?: pathinfo($image[0])['filename'],
3333
];
3434
}
3535
return $array;
@@ -39,12 +39,12 @@ public function imagesParse($column = null, $index = null, $array = false)
3939

4040
public function image($column = null, $index = 0)
4141
{
42-
return trim($this->imagesParse($column, $index)[0] ?? null) ?: null;
42+
return trim($this->imagesParse($column, $index)[0] ?? '') ?: null;
4343
}
4444

4545
public function imageCaption($column = null, $index = 0)
4646
{
47-
return trim($this->imagesParse($column, $index)[1] ?? null) ?: null;
47+
return trim($this->imagesParse($column, $index)[1] ?? '') ?: null;
4848
}
4949

5050
public function imageCount($column = null)

0 commit comments

Comments
 (0)