]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Special/HTTPException.php
Merge remote-tracking branch 'upstream/2021.12-rc' into user-banner
[friendica.git] / src / Module / Special / HTTPException.php
index 8fe4c8ce5752054c5d462340bb2b66a35b07223f..95448606e5020fd2142cab89082de4f6a47e13ff 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
  *
@@ -51,7 +51,7 @@ class HTTPException
                        '$stack_trace' => DI::l10n()->t('Stack trace:'),
                ];
 
-               if (is_site_admin()) {
+               if (DI::app()->isSiteAdmin()) {
                        $vars['$thrown'] = DI::l10n()->t('Exception thrown in %s:%d', $e->getFile(), $e->getLine());
                        $vars['$trace'] = $e->getTraceAsString();
                }
@@ -65,7 +65,7 @@ class HTTPException
         * @param \Friendica\Network\HTTPException $e
         * @throws \Exception
         */
-       public static function rawContent(\Friendica\Network\HTTPException $e)
+       public function rawContent(\Friendica\Network\HTTPException $e)
        {
                $content = '';
 
@@ -84,12 +84,12 @@ class HTTPException
         * @return string
         * @throws \Exception
         */
-       public static function content(\Friendica\Network\HTTPException $e)
+       public function content(\Friendica\Network\HTTPException $e): string
        {
                header($_SERVER["SERVER_PROTOCOL"] . ' ' . $e->getCode() . ' ' . $e->getDescription());
 
                if ($e->getCode() >= 400) {
-                       Logger::debug('Exit with error', ['code' => $e->getCode(), 'description' => $e->getDescription(), 'query' => DI::args()->getQueryString(), 'callstack' => System::callstack(20), 'method' => $_SERVER['REQUEST_METHOD'], 'agent' => $_SERVER['HTTP_USER_AGENT'] ?? '']);
+                       Logger::debug('Exit with error', ['code' => $e->getCode(), 'description' => $e->getDescription(), 'query' => DI::args()->getQueryString(), 'callstack' => System::callstack(20), 'method' => DI::args()->getMethod(), 'agent' => $_SERVER['HTTP_USER_AGENT'] ?? '']);
                }
 
                $tpl = Renderer::getMarkupTemplate('exception.tpl');