$attachments should aways be an array

In order to avoid a PHP 7.2 error when using count()
This commit is contained in:
Pierre Rudloff 2018-04-24 16:22:29 +02:00
förälder 23371880e8
incheckning 9bb11ccfa5
1 ändrade filer med 2 tillägg och 2 borttagningar

Visa fil

@ -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 = [];