X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=mod%2Ftagrm.php;h=32cb19e691a461c97298e7b6300c79e6f53c8d00;hb=5974d045a52aa70d9971053c09b07d4d25e285c3;hp=4022f999db3c04a87b7130e3d358dca6e2a0a1db;hpb=dc42dbb68a50fb2c60f439393eb6d1fe80b327cf;p=friendica.git diff --git a/mod/tagrm.php b/mod/tagrm.php index 4022f999db..32cb19e691 100644 --- a/mod/tagrm.php +++ b/mod/tagrm.php @@ -1,6 +1,6 @@ t('Tag(s) removed') . EOL); DI::baseUrl()->redirect($_SESSION['photo_return']); // NOTREACHED @@ -63,7 +61,7 @@ function update_tags($item_id, $tags) return; } - $item = Item::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => local_user()]); + $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => local_user()]); if (!DBA::isResult($item)) { return; } @@ -81,25 +79,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']); + if (DI::args()->getArgc()== 3) { + update_tags(DI::args()->getArgv()[1], [trim(hex2bin(DI::args()->getArgv()[2]))]); + DI::baseUrl()->redirect($photo_return); } - $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0); + $item_id = ((DI::args()->getArgc()> 1) ? intval(DI::args()->getArgv()[1]) : 0); if (!$item_id) { - DI::baseUrl()->redirect($_SESSION['photo_return']); + DI::baseUrl()->redirect($photo_return); // NOTREACHED } - $item = Item::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => local_user()]); + $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 +107,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 .= '