]> git.mxchange.org Git - friendica.git/commitdiff
Some more "exit" replaced
authorMichael <heluecht@pirati.ca>
Sun, 10 Apr 2022 11:03:24 +0000 (11:03 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 10 Apr 2022 11:03:24 +0000 (11:03 +0000)
mod/cal.php
mod/events.php
mod/fbrowser.php
mod/oexchange.php
src/Module/ParseUrl.php
view/templates/oexchange_xrd.tpl
view/templates/poco_xml.tpl

index dea1c2b9eaabd7fb12c1d312e4a8b47e35c81f38..3f249da0aca21c457146fd4243eebc669ea06430 100644 (file)
@@ -254,8 +254,7 @@ function cal_content(App $a)
                ]);
 
                if (!empty($_GET['id'])) {
-                       echo $o;
-                       exit();
+                       System::httpExit($o);
                }
 
                return $o;
index 4db595ccc071232f845bce048b71b895b89a097d..082cdf55dd7ca5401b2bc9ae4c956c1ec0a365e1 100644 (file)
@@ -27,6 +27,7 @@ use Friendica\Core\ACL;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
+use Friendica\Core\System;
 use Friendica\Core\Theme;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
@@ -122,8 +123,7 @@ function events_post(App $a)
        if (strcmp($finish, $start) < 0 && !$nofinish) {
                notice(DI::l10n()->t('Event can not end before it has started.'));
                if (intval($_REQUEST['preview'])) {
-                       echo DI::l10n()->t('Event can not end before it has started.');
-                       exit();
+                       System::httpExit(DI::l10n()->t('Event can not end before it has started.'));
                }
                DI::baseUrl()->redirect($onerror_path);
        }
@@ -131,8 +131,7 @@ function events_post(App $a)
        if (!$summary || ($start === DBA::NULL_DATETIME)) {
                notice(DI::l10n()->t('Event title and start time are required.'));
                if (intval($_REQUEST['preview'])) {
-                       echo DI::l10n()->t('Event title and start time are required.');
-                       exit();
+                       System::httpExit(DI::l10n()->t('Event title and start time are required.'));
                }
                DI::baseUrl()->redirect($onerror_path);
        }
@@ -192,9 +191,7 @@ function events_post(App $a)
        $datarray['id']        = $event_id;
 
        if (intval($_REQUEST['preview'])) {
-               $html = Event::getHTML($datarray);
-               echo $html;
-               exit();
+               System::httpExit(Event::getHTML($datarray));
        }
 
        $event_id = Event::store($datarray);
@@ -391,8 +388,7 @@ function events_content(App $a)
                ]);
 
                if (!empty($_GET['id'])) {
-                       echo $o;
-                       exit();
+                       System::httpExit($o);
                }
 
                return $o;
index d918021cf2d6e880c6151c337cdee6e2d58d4979..1646b19dff606206036ae3b561f333347e226150 100644 (file)
@@ -24,6 +24,7 @@
 
 use Friendica\App;
 use Friendica\Core\Renderer;
+use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Photo;
@@ -153,7 +154,6 @@ function fbrowser_content(App $a)
        if (!empty($_GET['mode'])) {
                return $o;
        } else {
-               echo $o;
-               exit();
+               System::httpExit($o);
        }
 }
index 31306a608e9e378c7e4465b7ddb8f98e95fb6269..e279bfff29442e88f1389c0ec0f97673d329c731 100644 (file)
@@ -21,7 +21,9 @@
 
 use Friendica\App;
 use Friendica\Core\Renderer;
+use Friendica\Core\System;
 use Friendica\DI;
+use Friendica\Module\Response;
 use Friendica\Module\Security\Login;
 
 function oexchange_init(App $a) {
@@ -30,8 +32,7 @@ function oexchange_init(App $a) {
                $tpl = Renderer::getMarkupTemplate('oexchange_xrd.tpl');
 
                $o = Renderer::replaceMacros($tpl, ['$base' => DI::baseUrl()]);
-               echo $o;
-               exit();
+               System::httpExit($o, Response::TYPE_XML);
        }
 }
 
index afb54ea325b35936643e8e90e923a893c1da8fc5..91d09240b7e6d39e5b530f3c28fc10643ba17915 100644 (file)
@@ -88,8 +88,7 @@ class ParseUrl extends BaseModule
                        if ($format == 'json') {
                                System::jsonExit($arr['text']);
                        } else {
-                               echo $arr['text'];
-                               exit();
+                               System::httpExit($arr['text']);
                        }
                }
 
@@ -122,8 +121,7 @@ class ParseUrl extends BaseModule
 
                        System::jsonExit($ret);
                } else {
-                       echo BBCode::embedURL($url, empty($_GET['noAttachment']), $title, $description, $_GET['tags'] ?? '');
-                       exit();
+                       System::httpExit(BBCode::embedURL($url, empty($_GET['noAttachment']), $title, $description, $_GET['tags'] ?? ''));
                }
        }
 }
index aa952c0f490d228ceccd9e665574c85dab318210..7c31f2126cfab3c7cfae6f2fc42f550968d89e7b 100644 (file)
@@ -1,4 +1,3 @@
-
 <?xml version='1.0' encoding='UTF-8'?>
 <XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
         
@@ -31,4 +30,3 @@
         type="text/html" 
         />
 </XRD>
-
index 82c67c8de56c3ccb8f4ee626051202ab2eeba5b5..0e38a692c4532acf03fafd9f66c103e265dc49be 100644 (file)
@@ -1,4 +1,3 @@
-
 <?xml version="1.0" encoding="utf-8"?>
 <response>
 {{if $response.sorted}}<sorted>{{$response.sorted}}</sorted>{{/if}}