X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Ftagrm.php;h=b60823e31a47bfb0aee2d31c061324addf854e31;hb=2a442952b69987d578288891c064b0fed0369086;hp=179276663b0fc5e60dba427ccae776c39d4d5d55;hpb=c6b45a958e3b09bc8f3950a718c181dfc9e0b910;p=friendica.git diff --git a/mod/tagrm.php b/mod/tagrm.php index 179276663b..b60823e31a 100644 --- a/mod/tagrm.php +++ b/mod/tagrm.php @@ -1,6 +1,6 @@ $item_id, 'uid' => local_user()]); + $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => local_user()]); if (!DBA::isResult($item)) { return; } @@ -80,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']); + if (DI::args()->getArgc()== 3) { + update_tags(DI::args()->getArgv()[1], [Strings::escapeTags(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']); @@ -106,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 .= '