]> git.mxchange.org Git - friendica.git/commitdiff
friendica-7130 Edits of images not possible
authorPhilipp Holzer <admin+github@philipp.info>
Sun, 26 May 2019 13:00:19 +0000 (15:00 +0200)
committerPhilipp Holzer <admin+github@philipp.info>
Sun, 26 May 2019 13:00:19 +0000 (15:00 +0200)
mod/photos.php

index 61f1b795301836f96687f3bbc38d8d27d974bf91..b18c06e2a3a4e5bf4b410f47b1a83f3c910b1245 100644 (file)
@@ -29,8 +29,8 @@ use Friendica\Util\Crypto;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Map;
 use Friendica\Util\Security;
-use Friendica\Util\Temporal;
 use Friendica\Util\Strings;
+use Friendica\Util\Temporal;
 use Friendica\Util\XML;
 
 function photos_init(App $a) {
@@ -315,7 +315,7 @@ function photos_post(App $a)
                $str_group_deny    = !empty($_POST['group_deny'])    ? perms2str($_POST['group_deny'])    : '';
                $str_contact_deny  = !empty($_POST['contact_deny'])  ? perms2str($_POST['contact_deny'])  : '';
 
-               $resource_id = $a->argv[2];
+               $resource_id = $a->argv[3];
 
                if (!strlen($albname)) {
                        $albname = DateTimeFormat::localNow('Y');
@@ -418,10 +418,11 @@ function photos_post(App $a)
 
                if ($item_id) {
                        $item = Item::selectFirst(['tag', 'inform'], ['id' => $item_id, 'uid' => $page_owner_uid]);
-               }
-               if (DBA::isResult($item)) {
-                       $old_tag    = $item['tag'];
-                       $old_inform = $item['inform'];
+
+                       if (DBA::isResult($item)) {
+                               $old_tag    = $item['tag'];
+                               $old_inform = $item['inform'];
+                       }
                }
 
                if (strlen($rawtags)) {
@@ -524,13 +525,13 @@ function photos_post(App $a)
                                }
                        }
 
-                       $newtag = $old_tag;
+                       $newtag = $old_tag ?? '';
                        if (strlen($newtag) && strlen($str_tags)) {
                                $newtag .= ',';
                        }
                        $newtag .= $str_tags;
 
-                       $newinform = $old_inform;
+                       $newinform = $old_inform ?? '';
                        if (strlen($newinform) && strlen($inform)) {
                                $newinform .= ',';
                        }
@@ -735,7 +736,7 @@ function photos_post(App $a)
                @unlink($src);
                $foo = 0;
                Hook::callAll('photo_post_end',$foo);
-               exit();
+               return;
        }
 
        $exif = $image->orient($src);
@@ -761,7 +762,7 @@ function photos_post(App $a)
        if (!$r) {
                Logger::log('mod/photos.php: photos_post(): image store failed', Logger::DEBUG);
                notice(L10n::t('Image upload failed.') . EOL);
-               exit();
+               return;
        }
 
        if ($width > 640 || $height > 640) {