From: Philipp Holzer Date: Sun, 26 May 2019 13:00:19 +0000 (+0200) Subject: friendica-7130 Edits of images not possible X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2652787460c7dea02dc387945854bb40be00c8d6;p=friendica.git friendica-7130 Edits of images not possible --- diff --git a/mod/photos.php b/mod/photos.php index 61f1b79530..b18c06e2a3 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -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) {