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'])) {
echo $o;
exit();
System::httpExit($o);
}
return $o;

View 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;

View 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);
}
}

View 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);
}
}

View 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'] ?? ''));
}
}
}

View 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>

View file

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