]> git.mxchange.org Git - friendica.git/blobdiff - mod/tagrm.php
Merge pull request #11575 from annando/issue-11469
[friendica.git] / mod / tagrm.php
index 145f636cc41c1a428b79bde8e74ebabad3af7a7d..fdf3ef4f8f4cfee64f55056fd07651737c644c18 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -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;
@@ -88,12 +86,12 @@ function tagrm_content(App $a)
                // NOTREACHED
        }
 
-       if ($a->argc == 3) {
-               update_tags($a->argv[1], [Strings::escapeTags(trim(hex2bin($a->argv[2])))]);
+       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($photo_return);
                // NOTREACHED