From e42a9254c0e94588e200d02ef1cd242f0fdc1d64 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 31 May 2021 01:22:07 -0400 Subject: [PATCH] Ensure photo_return string is set in tagrm_content - Address https://github.com/friendica/friendica/issues/10169#issuecomment-835546485 --- mod/tagrm.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mod/tagrm.php b/mod/tagrm.php index e81bd2af3..145f636cc 100644 --- a/mod/tagrm.php +++ b/mod/tagrm.php @@ -81,25 +81,27 @@ function tagrm_content(App $a) { $o = ''; + $photo_return = $_SESSION['photo_return'] ?? ''; + if (!local_user()) { - DI::baseUrl()->redirect($_SESSION['photo_return']); + DI::baseUrl()->redirect($photo_return); // NOTREACHED } if ($a->argc == 3) { update_tags($a->argv[1], [Strings::escapeTags(trim(hex2bin($a->argv[2])))]); - DI::baseUrl()->redirect($_SESSION['photo_return']); + DI::baseUrl()->redirect($photo_return); } $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0); if (!$item_id) { - DI::baseUrl()->redirect($_SESSION['photo_return']); + DI::baseUrl()->redirect($photo_return); // NOTREACHED } $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => local_user()]); if (!DBA::isResult($item)) { - DI::baseUrl()->redirect($_SESSION['photo_return']); + DI::baseUrl()->redirect($photo_return); } $tag_text = Tag::getCSVByURIId($item['uri-id']); @@ -107,7 +109,7 @@ function tagrm_content(App $a) $arr = explode(',', $tag_text); if (empty($arr)) { - DI::baseUrl()->redirect($_SESSION['photo_return']); + DI::baseUrl()->redirect($photo_return); } $o .= '

' . DI::l10n()->t('Remove Item Tag') . '

';