]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Debug/ItemBody.php
Merge pull request #12896 from HankG/mastodon-status-edit-fix-link-preview-changing
[friendica.git] / src / Module / Debug / ItemBody.php
index a9a3c0b50b0f593022b59568b562cb1d324d79ef..6bc1419d3463e08e0d550c03b756bbb09d6013f9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -34,7 +34,7 @@ class ItemBody extends BaseModule
 {
        protected function content(array $request = []): string
        {
-               if (!local_user()) {
+               if (!DI::userSession()->getLocalUserId()) {
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('Access denied.'));
                }
 
@@ -44,7 +44,7 @@ class ItemBody extends BaseModule
 
                $itemId = intval($this->parameters['item']);
 
-               $item = Post::selectFirst(['body'], ['uid' => [0, local_user()], 'uri-id' => $itemId]);
+               $item = Post::selectFirst(['body'], ['uid' => [0, DI::userSession()->getLocalUserId()], 'uri-id' => $itemId]);
 
                if (!empty($item)) {
                        if (DI::mode()->isAjax()) {