From 9bb11ccfa5ddd8e614be18b0c5b217d66cfae4a0 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 24 Apr 2018 16:22:29 +0200 Subject: [PATCH] $attachments should aways be an array In order to avoid a PHP 7.2 error when using count() --- include/api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/api.php b/include/api.php index f0120684c9..ebf48c9b78 100644 --- a/include/api.php +++ b/include/api.php @@ -2716,7 +2716,7 @@ function api_convert_item($item) * * @param string $body * - * @return array|false + * @return array */ function api_get_attachments(&$body) { @@ -2727,7 +2727,7 @@ function api_get_attachments(&$body) $ret = preg_match_all("/\[img\]([$URLSearchString]*)\[\/img\]/ism", $text, $images); if (!$ret) { - return false; + return []; } $attachments = [];