]> git.mxchange.org Git - friendica.git/commitdiff
Fix wrong default value in Module\Api\Friendica\Photo\Create::post
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 17 Jan 2022 21:46:43 +0000 (16:46 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 17 Jan 2022 21:46:43 +0000 (16:46 -0500)
- The underlying Model\Photo::upload doesn't accept a null value for description

src/Model/Photo.php
src/Module/Api/Friendica/Photo/Create.php

index 2edca93870806066742d40ddd14c23573f4238f2..91d827826d7e53dde403e1c675accc4d153eb9b7 100644 (file)
@@ -973,10 +973,17 @@ class Photo
        }
 
        /**
-        *
-        * @param int   $uid   User ID
-        * @param array $files uploaded file array
+        * @param int         $uid   User ID
+        * @param array       $files uploaded file array
+        * @param string      $album
+        * @param string|null $allow_cid
+        * @param string|null $allow_gid
+        * @param string      $deny_cid
+        * @param string      $deny_gid
+        * @param string      $desc
+        * @param string      $resource_id
         * @return array photo record
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        public static function upload(int $uid, array $files, string $album = '', string $allow_cid = null, string $allow_gid = null, string $deny_cid = '', string $deny_gid = '', string $desc = '', string $resource_id = ''): array
        {
index c207820b0ffe36acadc3a17ce61157a8a832a6b2..62889d328c9acbd3d504cd7099f1ebaa56b4668d 100644 (file)
@@ -55,7 +55,7 @@ class Create extends BaseApi
                $type = $this->getRequestValue($this->parameters, 'extension', 'json');
 
                // input params
-               $desc      = $this->getRequestValue($request, 'desc');
+               $desc      = $this->getRequestValue($request, 'desc') ?? '';
                $album     = $this->getRequestValue($request, 'album');
                $allow_cid = $this->getRequestValue($request, 'allow_cid');
                $deny_cid  = $this->getRequestValue($request, 'deny_cid');