X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Ftagrm.php;h=32cb19e691a461c97298e7b6300c79e6f53c8d00;hb=b5d2d32b443f7aa8ec6e0e91f36da3cc0a0f2a82;hp=e81bd2af38940439120b16c9d9928c5388cb8636;hpb=38a5358bfa646ae13a4a1a385741890fa88d9b7f;p=friendica.git diff --git a/mod/tagrm.php b/mod/tagrm.php index e81bd2af38..32cb19e691 100644 --- a/mod/tagrm.php +++ b/mod/tagrm.php @@ -23,10 +23,8 @@ use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Database\DBA; use Friendica\DI; -use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\Tag; -use Friendica\Util\Strings; function tagrm_post(App $a) { @@ -40,7 +38,7 @@ function tagrm_post(App $a) $tags = []; foreach ($_POST['tag'] ?? [] as $tag) { - $tags[] = hex2bin(Strings::escapeTags(trim($tag))); + $tags[] = hex2bin(trim($tag)); } $item_id = $_POST['item'] ?? 0; @@ -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 = 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 .= '