]> git.mxchange.org Git - friendica.git/commitdiff
$attachments should aways be an array
authorPierre Rudloff <contact@rudloff.pro>
Tue, 24 Apr 2018 14:22:29 +0000 (16:22 +0200)
committerPierre Rudloff <contact@rudloff.pro>
Tue, 8 May 2018 10:16:48 +0000 (12:16 +0200)
In order to avoid a PHP 7.2 error when using count()

include/api.php

index f0120684c99d218e45613f137f5d8adba2883cb7..ebf48c9b78957b68f3a97a8621207961e8786eae 100644 (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 = [];