]> git.mxchange.org Git - friendica.git/blobdiff - mod/tagrm.php
Fix missing/wrong IHandleUserSessions usages
[friendica.git] / mod / tagrm.php
index 32cb19e691a461c97298e7b6300c79e6f53c8d00..26d2c905fda41dd939ab3fcee506c9aec3b06260 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
  *
@@ -28,7 +28,7 @@ use Friendica\Model\Tag;
 
 function tagrm_post(App $a)
 {
-       if (!local_user()) {
+       if (!DI::userSession()->getLocalUserId()) {
                DI::baseUrl()->redirect($_SESSION['photo_return']);
        }
 
@@ -61,7 +61,7 @@ function update_tags($item_id, $tags)
                return;
        }
 
-       $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => local_user()]);
+       $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => DI::userSession()->getLocalUserId()]);
        if (!DBA::isResult($item)) {
                return;
        }
@@ -81,7 +81,7 @@ function tagrm_content(App $a)
 
        $photo_return = $_SESSION['photo_return'] ?? '';
 
-       if (!local_user()) {
+       if (!DI::userSession()->getLocalUserId()) {
                DI::baseUrl()->redirect($photo_return);
                // NOTREACHED
        }
@@ -97,7 +97,7 @@ function tagrm_content(App $a)
                // NOTREACHED
        }
 
-       $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => local_user()]);
+       $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => DI::userSession()->getLocalUserId()]);
        if (!DBA::isResult($item)) {
                DI::baseUrl()->redirect($photo_return);
        }