Some more "exit" replaced

This commit is contained in:
Michael 2022-04-10 11:03:24 +00:00
parent 4a22034be6
commit 989ac2fda8
7 changed files with 13 additions and 22 deletions

View File

@ -254,8 +254,7 @@ function cal_content(App $a)
]); ]);
if (!empty($_GET['id'])) { if (!empty($_GET['id'])) {
echo $o; System::httpExit($o);
exit();
} }
return $o; return $o;

View File

@ -27,6 +27,7 @@ use Friendica\Core\ACL;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Core\Theme; use Friendica\Core\Theme;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBA; use Friendica\Database\DBA;
@ -122,8 +123,7 @@ function events_post(App $a)
if (strcmp($finish, $start) < 0 && !$nofinish) { if (strcmp($finish, $start) < 0 && !$nofinish) {
notice(DI::l10n()->t('Event can not end before it has started.')); notice(DI::l10n()->t('Event can not end before it has started.'));
if (intval($_REQUEST['preview'])) { if (intval($_REQUEST['preview'])) {
echo DI::l10n()->t('Event can not end before it has started.'); System::httpExit(DI::l10n()->t('Event can not end before it has started.'));
exit();
} }
DI::baseUrl()->redirect($onerror_path); DI::baseUrl()->redirect($onerror_path);
} }
@ -131,8 +131,7 @@ function events_post(App $a)
if (!$summary || ($start === DBA::NULL_DATETIME)) { if (!$summary || ($start === DBA::NULL_DATETIME)) {
notice(DI::l10n()->t('Event title and start time are required.')); notice(DI::l10n()->t('Event title and start time are required.'));
if (intval($_REQUEST['preview'])) { if (intval($_REQUEST['preview'])) {
echo DI::l10n()->t('Event title and start time are required.'); System::httpExit(DI::l10n()->t('Event title and start time are required.'));
exit();
} }
DI::baseUrl()->redirect($onerror_path); DI::baseUrl()->redirect($onerror_path);
} }
@ -192,9 +191,7 @@ function events_post(App $a)
$datarray['id'] = $event_id; $datarray['id'] = $event_id;
if (intval($_REQUEST['preview'])) { if (intval($_REQUEST['preview'])) {
$html = Event::getHTML($datarray); System::httpExit(Event::getHTML($datarray));
echo $html;
exit();
} }
$event_id = Event::store($datarray); $event_id = Event::store($datarray);
@ -391,8 +388,7 @@ function events_content(App $a)
]); ]);
if (!empty($_GET['id'])) { if (!empty($_GET['id'])) {
echo $o; System::httpExit($o);
exit();
} }
return $o; return $o;

View File

@ -24,6 +24,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Photo; use Friendica\Model\Photo;
@ -153,7 +154,6 @@ function fbrowser_content(App $a)
if (!empty($_GET['mode'])) { if (!empty($_GET['mode'])) {
return $o; return $o;
} else { } else {
echo $o; System::httpExit($o);
exit();
} }
} }

View File

@ -21,7 +21,9 @@
use Friendica\App; use Friendica\App;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Response;
use Friendica\Module\Security\Login; use Friendica\Module\Security\Login;
function oexchange_init(App $a) { function oexchange_init(App $a) {
@ -30,8 +32,7 @@ function oexchange_init(App $a) {
$tpl = Renderer::getMarkupTemplate('oexchange_xrd.tpl'); $tpl = Renderer::getMarkupTemplate('oexchange_xrd.tpl');
$o = Renderer::replaceMacros($tpl, ['$base' => DI::baseUrl()]); $o = Renderer::replaceMacros($tpl, ['$base' => DI::baseUrl()]);
echo $o; System::httpExit($o, Response::TYPE_XML);
exit();
} }
} }

View File

@ -88,8 +88,7 @@ class ParseUrl extends BaseModule
if ($format == 'json') { if ($format == 'json') {
System::jsonExit($arr['text']); System::jsonExit($arr['text']);
} else { } else {
echo $arr['text']; System::httpExit($arr['text']);
exit();
} }
} }
@ -122,8 +121,7 @@ class ParseUrl extends BaseModule
System::jsonExit($ret); System::jsonExit($ret);
} else { } else {
echo BBCode::embedURL($url, empty($_GET['noAttachment']), $title, $description, $_GET['tags'] ?? ''); System::httpExit(BBCode::embedURL($url, empty($_GET['noAttachment']), $title, $description, $_GET['tags'] ?? ''));
exit();
} }
} }
} }

View File

@ -1,4 +1,3 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"> <XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
@ -31,4 +30,3 @@
type="text/html" type="text/html"
/> />
</XRD> </XRD>

View File

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<response> <response>
{{if $response.sorted}}<sorted>{{$response.sorted}}</sorted>{{/if}} {{if $response.sorted}}<sorted>{{$response.sorted}}</sorted>{{/if}}