]> git.mxchange.org Git - friendica.git/commitdiff
Fix method parameter type in Model\Attach
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 7 Jan 2019 18:28:02 +0000 (13:28 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 21 Jan 2019 16:12:50 +0000 (11:12 -0500)
src/Model/Attach.php

index bfd5199bd5778fb211e01a587ae6fd0e37ab3c17..bd4269b9e39e23e9188ba97ef41f4b4ad975dca6 100644 (file)
@@ -11,6 +11,7 @@ use Friendica\Core\System;
 use Friendica\Core\StorageManager;
 use Friendica\Database\DBA;
 use Friendica\Database\DBStructure;
+use Friendica\Object\Image;
 use Friendica\Util\Security;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Mimetype;
@@ -257,9 +258,9 @@ class Attach extends BaseObject
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @see   \Friendica\Database\DBA::update
         */
-       public static function update($fields, $conditions, $img = null, array $old_fields = [])
+       public static function update($fields, $conditions, Image $img = null, array $old_fields = [])
        {
-               if (!is_null($data)) {
+               if (!is_null($img)) {
                        // get items to update
                        $items = self::select(['backend-class','backend-ref'], $conditions);
 
@@ -268,7 +269,7 @@ class Attach extends BaseObject
                                if ($backend_class !== '') {
                                        $fields['backend-ref'] = $backend_class::put($img->asString(), $item['backend-ref']);
                                } else {
-                                       $fields['data'] = $data;
+                                       $fields['data'] = $img->asString();
                                }
                        }
                }