Browse Source

$attachments should aways be an array

In order to avoid a PHP 7.2 error when using count()
tags/2018.09
Pierre Rudloff 2 years ago
parent
commit
9bb11ccfa5
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      include/api.php

+ 2
- 2
include/api.php View File

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


Loading…
Cancel
Save