From: Pierre Rudloff Date: Tue, 24 Apr 2018 14:22:29 +0000 (+0200) Subject: $attachments should aways be an array X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9bb11ccfa5ddd8e614be18b0c5b217d66cfae4a0;p=friendica.git $attachments should aways be an array In order to avoid a PHP 7.2 error when using count() --- 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 = [];