]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Debug/ItemBody.php
Merge pull request #12850 from nupplaphil/feat/phpstorm_editorconfig
[friendica.git] / src / Module / Debug / ItemBody.php
index 55abc894ed736d263bb0399ea41fb58ec98e635b..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
  *
@@ -22,6 +22,7 @@
 namespace Friendica\Module\Debug;
 
 use Friendica\BaseModule;
+use Friendica\Core\System;
 use Friendica\DI;
 use Friendica\Model\Post;
 use Friendica\Network\HTTPException;
@@ -33,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.'));
                }
 
@@ -43,12 +44,12 @@ 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()) {
                                echo str_replace("\n", '<br />', $item['body']);
-                               exit();
+                               System::exit();
                        } else {
                                return str_replace("\n", '<br />', $item['body']);
                        }