]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/System.php
Merge pull request #11810 from MrPetovan/task/11794-password-length-limit
[friendica.git] / src / Core / System.php
index 66b6b25a501e16245019c8a8f0bde0885dac56fe..8712b6ca5965f1a5820bd6544957ef6508df7a7e 100644 (file)
@@ -295,7 +295,7 @@ class System
                DI::apiResponse()->addContent(XML::fromArray(["result" => $result], $xml));
                DI::page()->exit(DI::apiResponse()->generate());
 
-               exit();
+               self::exit();
        }
 
        /**
@@ -315,7 +315,7 @@ class System
                DI::apiResponse()->addContent($content);
                DI::page()->exit(DI::apiResponse()->generate());
 
-               exit();
+               self::exit();
        }
 
        /**
@@ -331,7 +331,8 @@ class System
                DI::apiResponse()->setType($responce, $content_type);
                DI::apiResponse()->addContent($content);
                DI::page()->exit(DI::apiResponse()->generate());
-               exit();
+
+               self::exit();
        }
 
        public static function jsonError($httpCode, $content, $content_type = 'application/json')
@@ -359,6 +360,16 @@ class System
                DI::apiResponse()->setType(Response::TYPE_JSON, $content_type);
                DI::apiResponse()->addContent(json_encode($content, $options));
                DI::page()->exit(DI::apiResponse()->generate());
+
+               self::exit();
+       }
+
+       /**
+        * Exit the program execution.
+        */
+       public static function exit()
+       {
+               DI::page()->logRuntime(DI::config(), 'exit');
                exit();
        }
 
@@ -430,6 +441,12 @@ class System
         *
         * @param string $url  The new Location to redirect
         * @param int    $code The redirection code, which is used (Default is 302)
+        *
+        * @throws FoundException
+        * @throws MovedPermanentlyException
+        * @throws TemporaryRedirectException
+        *
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        public static function externalRedirect($url, $code = 302)
        {
@@ -448,8 +465,7 @@ class System
                        case 307:
                                throw new TemporaryRedirectException();
                }
-
-               exit();
+               self::exit();
        }
 
        /**
@@ -522,7 +538,7 @@ class System
                echo str_replace("\t", "       ", $o);
                echo "</section>";
                echo "</body></html>\r\n";
-               exit();
+               self::exit();
        }
 
        /**