Remove/replace killme() with *exit()

This commit is contained in:
Hypolite Petovan 2018-12-26 00:40:12 -05:00
parent df386800d3
commit 895b3abf32
75 changed files with 167 additions and 187 deletions

View file

@ -44,7 +44,7 @@ $spawn = array_key_exists('s', $options) || array_key_exists('spawn', $options);
if ($spawn) { if ($spawn) {
Worker::spawnWorker(); Worker::spawnWorker();
killme(); exit();
} }
$run_cron = !array_key_exists('n', $options) && !array_key_exists('no_cron', $options); $run_cron = !array_key_exists('n', $options) && !array_key_exists('no_cron', $options);

View file

@ -3928,10 +3928,10 @@ function api_oauth_request_token()
$r = $oauth1->fetch_request_token(OAuthRequest::from_request()); $r = $oauth1->fetch_request_token(OAuthRequest::from_request());
} catch (Exception $e) { } catch (Exception $e) {
echo "error=" . OAuthUtil::urlencode_rfc3986($e->getMessage()); echo "error=" . OAuthUtil::urlencode_rfc3986($e->getMessage());
killme(); exit();
} }
echo $r; echo $r;
killme(); exit();
} }
/** /**
@ -3947,10 +3947,10 @@ function api_oauth_access_token()
$r = $oauth1->fetch_access_token(OAuthRequest::from_request()); $r = $oauth1->fetch_access_token(OAuthRequest::from_request());
} catch (Exception $e) { } catch (Exception $e) {
echo "error=". OAuthUtil::urlencode_rfc3986($e->getMessage()); echo "error=". OAuthUtil::urlencode_rfc3986($e->getMessage());
killme(); exit();
} }
echo $r; echo $r;
killme(); exit();
} }
/// @TODO move to top of file or somewhere better /// @TODO move to top of file or somewhere better

View file

@ -91,7 +91,6 @@ abstract class OAuthSignatureMethod {
*/ */
public function check_signature($request, $consumer, $token, $signature) { public function check_signature($request, $consumer, $token, $signature) {
$built = $this->build_signature($request, $consumer, $token); $built = $this->build_signature($request, $consumer, $token);
//echo "<pre>"; var_dump($signature, $built, ($built == $signature)); killme();
return ($built == $signature); return ($built == $signature);
} }
} }
@ -296,7 +295,6 @@ class OAuthRequest {
$http_url = substr($http_url, 0, strpos($http_url,$parameters['pagename'])+strlen($parameters['pagename'])); $http_url = substr($http_url, 0, strpos($http_url,$parameters['pagename'])+strlen($parameters['pagename']));
unset( $parameters['pagename'] ); unset( $parameters['pagename'] );
//echo "<pre>".__function__."\n"; var_dump($http_method, $http_url, $parameters, $_SERVER['REQUEST_URI']); killme();
return new OAuthRequest($http_method, $http_url, $parameters); return new OAuthRequest($http_method, $http_url, $parameters);
} }
@ -561,7 +559,6 @@ class OAuthServer {
public function verify_request(&$request) { public function verify_request(&$request) {
$this->get_version($request); $this->get_version($request);
$consumer = $this->get_consumer($request); $consumer = $this->get_consumer($request);
//echo __file__.__line__.__function__."<pre>"; var_dump($consumer); die();
$token = $this->get_token($request, $consumer, "access"); $token = $this->get_token($request, $consumer, "access");
$this->check_signature($request, $consumer, $token); $this->check_signature($request, $consumer, $token);
return array($consumer, $token); return array($consumer, $token);

View file

@ -27,7 +27,6 @@ function _well_known_init(App $a)
} }
} }
System::httpExit(404); System::httpExit(404);
killme();
} }
function wk_social_relay() function wk_social_relay()

View file

@ -301,8 +301,7 @@ function admin_content(App $a)
if ($a->isAjax()) { if ($a->isAjax()) {
echo $o; echo $o;
killme(); exit();
return '';
} else { } else {
return $o; return $o;
} }

View file

@ -47,5 +47,5 @@ function amcd_content()
} }
} }
JSON; JSON;
killme(); exit();
} }

View file

@ -59,7 +59,7 @@ function api_content(App $a)
} catch (Exception $e) { } catch (Exception $e) {
echo "<pre>"; echo "<pre>";
var_dump($e); var_dump($e);
killme(); exit();
} }
if (!empty($_POST['oauth_yes'])) { if (!empty($_POST['oauth_yes'])) {
@ -79,7 +79,7 @@ function api_content(App $a)
$glue = "?"; $glue = "?";
} }
$a->internalRedirect($consumer->callback_url . $glue . 'oauth_token=' . OAuthUtil::urlencode_rfc3986($params['oauth_token']) . '&oauth_verifier=' . OAuthUtil::urlencode_rfc3986($verifier)); $a->internalRedirect($consumer->callback_url . $glue . 'oauth_token=' . OAuthUtil::urlencode_rfc3986($params['oauth_token']) . '&oauth_verifier=' . OAuthUtil::urlencode_rfc3986($verifier));
killme(); exit();
} }
$tpl = Renderer::getMarkupTemplate("oauth_authorize_done.tpl"); $tpl = Renderer::getMarkupTemplate("oauth_authorize_done.tpl");
@ -117,5 +117,5 @@ function api_content(App $a)
} }
echo api_call($a); echo api_call($a);
killme(); exit();
} }

View file

@ -49,6 +49,6 @@ function attach_init(App $a)
} }
echo $r[0]['data']; echo $r[0]['data'];
killme(); exit();
// NOTREACHED // NOTREACHED
} }

View file

@ -244,7 +244,7 @@ function cal_content(App $a)
if (!empty($a->argv[2]) && ($a->argv[2] === 'json')) { if (!empty($a->argv[2]) && ($a->argv[2] === 'json')) {
echo json_encode($events); echo json_encode($events);
killme(); exit();
} }
// links: array('href', 'text', 'extra css classes', 'title') // links: array('href', 'text', 'extra css classes', 'title')
@ -286,7 +286,7 @@ function cal_content(App $a)
if (!empty($_GET['id'])) { if (!empty($_GET['id'])) {
echo $o; echo $o;
killme(); exit();
} }
return $o; return $o;
@ -331,7 +331,7 @@ function cal_content(App $a)
header('Content-type: text/calendar'); header('Content-type: text/calendar');
header('content-disposition: attachment; filename="' . L10n::t('calendar') . '-' . $nick . '.' . $evexport["extension"] . '"'); header('content-disposition: attachment; filename="' . L10n::t('calendar') . '-' . $nick . '.' . $evexport["extension"] . '"');
echo $evexport["content"]; echo $evexport["content"];
killme(); exit();
} }
return; return;

View file

@ -8,7 +8,7 @@ use Friendica\Model\Group;
function contactgroup_content(App $a) function contactgroup_content(App $a)
{ {
if (!local_user()) { if (!local_user()) {
killme(); exit();
} }
$change = null; $change = null;
@ -28,7 +28,7 @@ function contactgroup_content(App $a)
intval(local_user()) intval(local_user())
); );
if (!DBA::isResult($r)) { if (!DBA::isResult($r)) {
killme(); exit();
} }
$group = $r[0]; $group = $r[0];
@ -49,5 +49,5 @@ function contactgroup_content(App $a)
} }
} }
killme(); exit();
} }

View file

@ -281,7 +281,7 @@ function dfrn_notify_content(App $a) {
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $a->argv[1]]); $user = DBA::selectFirst('user', ['uid'], ['nickname' => $a->argv[1]]);
if (!DBA::isResult($user)) { if (!DBA::isResult($user)) {
Logger::log('User not found for nickname ' . $a->argv[1]); Logger::log('User not found for nickname ' . $a->argv[1]);
killme(); exit();
} }
$condition = []; $condition = [];
@ -313,7 +313,7 @@ function dfrn_notify_content(App $a) {
$importer = DFRN::getImporter($contact['id'], $user['uid']); $importer = DFRN::getImporter($contact['id'], $user['uid']);
if (empty($importer)) { if (empty($importer)) {
Logger::log('No importer data found for user ' . $a->argv[1] . ' and contact ' . $dfrn_id); Logger::log('No importer data found for user ' . $a->argv[1] . ' and contact ' . $dfrn_id);
killme(); exit();
} }
Logger::log("Remote rino version: ".$rino_remote." for ".$importer["url"], Logger::DATA); Logger::log("Remote rino version: ".$rino_remote." for ".$importer["url"], Logger::DATA);
@ -370,6 +370,6 @@ function dfrn_notify_content(App $a) {
. "\t" . '<challenge>' . $challenge . '</challenge>' . "\r\n" . "\t" . '<challenge>' . $challenge . '</challenge>' . "\r\n"
. '</dfrn_notify>' . "\r\n"; . '</dfrn_notify>' . "\r\n";
killme(); exit();
} }
} }

View file

@ -37,7 +37,7 @@ function dfrn_poll_init(App $a)
$nickname = $a->argv[1]; $nickname = $a->argv[1];
header("Content-type: application/atom+xml"); header("Content-type: application/atom+xml");
echo OStatus::feed($nickname, $last_update, 10); echo OStatus::feed($nickname, $last_update, 10);
killme(); exit();
} }
$direction = -1; $direction = -1;
@ -71,7 +71,7 @@ function dfrn_poll_init(App $a)
Logger::log('dfrn_poll: public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $user); Logger::log('dfrn_poll: public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $user);
header("Content-type: application/atom+xml"); header("Content-type: application/atom+xml");
echo DFRN::feed('', $user, $last_update, 0, $hidewall); echo DFRN::feed('', $user, $last_update, 0, $hidewall);
killme(); exit();
} }
if (($type === 'profile') && (!strlen($sec))) { if (($type === 'profile') && (!strlen($sec))) {
@ -198,7 +198,7 @@ function dfrn_poll_init(App $a)
header("Content-type: text/xml"); header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?><dfrn_poll><status>0</status><challenge>$decoded_challenge</challenge><sec>$sec</sec></dfrn_poll>"; echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?><dfrn_poll><status>0</status><challenge>$decoded_challenge</challenge><sec>$sec</sec></dfrn_poll>";
killme(); exit();
// NOTREACHED // NOTREACHED
} else { } else {
// old protocol // old protocol
@ -290,7 +290,7 @@ function dfrn_poll_post(App $a)
header("Content-type: text/xml"); header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?><dfrn_poll><status>0</status><challenge>$decoded_challenge</challenge><sec>$sec</sec></dfrn_poll>"; echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?><dfrn_poll><status>0</status><challenge>$decoded_challenge</challenge><sec>$sec</sec></dfrn_poll>";
killme(); exit();
// NOTREACHED // NOTREACHED
} }
} }
@ -307,7 +307,7 @@ function dfrn_poll_post(App $a)
); );
if (!DBA::isResult($r)) { if (!DBA::isResult($r)) {
killme(); exit();
} }
$type = $r[0]['type']; $type = $r[0]['type'];
@ -336,7 +336,7 @@ function dfrn_poll_post(App $a)
$r = q("SELECT * FROM `contact` WHERE `blocked` = 0 AND `pending` = 0 $sql_extra LIMIT 1"); $r = q("SELECT * FROM `contact` WHERE `blocked` = 0 AND `pending` = 0 $sql_extra LIMIT 1");
if (!DBA::isResult($r)) { if (!DBA::isResult($r)) {
killme(); exit();
} }
$contact = $r[0]; $contact = $r[0];
@ -368,7 +368,7 @@ function dfrn_poll_post(App $a)
<description>$text</description> <description>$text</description>
</reputation> </reputation>
"; ";
killme(); exit();
// NOTREACHED // NOTREACHED
} else { } else {
// Update the writable flag if it changed // Update the writable flag if it changed
@ -391,7 +391,7 @@ function dfrn_poll_post(App $a)
header("Content-type: application/atom+xml"); header("Content-type: application/atom+xml");
$o = DFRN::feed($dfrn_id, $a->argv[1], $last_update, $direction); $o = DFRN::feed($dfrn_id, $a->argv[1], $last_update, $direction);
echo $o; echo $o;
killme(); exit();
} }
} }
@ -573,7 +573,7 @@ function dfrn_poll_content(App $a)
. "\t" . '<dfrn_id>' . $encrypted_id . '</dfrn_id>' . "\r\n" . "\t" . '<dfrn_id>' . $encrypted_id . '</dfrn_id>' . "\r\n"
. "\t" . '<challenge>' . $challenge . '</challenge>' . "\r\n" . "\t" . '<challenge>' . $challenge . '</challenge>' . "\r\n"
. '</dfrn_poll>' . "\r\n"; . '</dfrn_poll>' . "\r\n";
killme(); exit();
// NOTREACHED // NOTREACHED
} }
} }

View file

@ -589,8 +589,7 @@ function dfrn_request_content(App $a)
} }
} }
killme(); exit();
return; // NOTREACHED
} else { } else {
// Normal web request. Display our user's introduction form. // Normal web request. Display our user's introduction form.
if ((Config::get('system', 'block_public')) && (!local_user()) && (!remote_user())) { if ((Config::get('system', 'block_public')) && (!local_user()) && (!remote_user())) {

View file

@ -426,5 +426,5 @@ function displayShowFeed($item_id, $conversation)
} }
header("Content-type: application/atom+xml"); header("Content-type: application/atom+xml");
echo $xml; echo $xml;
killme(); exit();
} }

View file

@ -117,7 +117,7 @@ function events_post(App $a)
notice(L10n::t('Event can not end before it has started.') . EOL); notice(L10n::t('Event can not end before it has started.') . EOL);
if (intval($_REQUEST['preview'])) { if (intval($_REQUEST['preview'])) {
echo L10n::t('Event can not end before it has started.'); echo L10n::t('Event can not end before it has started.');
killme(); exit();
} }
$a->internalRedirect($onerror_path); $a->internalRedirect($onerror_path);
} }
@ -126,7 +126,7 @@ function events_post(App $a)
notice(L10n::t('Event title and start time are required.') . EOL); notice(L10n::t('Event title and start time are required.') . EOL);
if (intval($_REQUEST['preview'])) { if (intval($_REQUEST['preview'])) {
echo L10n::t('Event title and start time are required.'); echo L10n::t('Event title and start time are required.');
killme(); exit();
} }
$a->internalRedirect($onerror_path); $a->internalRedirect($onerror_path);
} }
@ -414,7 +414,7 @@ function events_content(App $a)
if (!empty($_GET['id'])) { if (!empty($_GET['id'])) {
echo $o; echo $o;
killme(); exit();
} }
return $o; return $o;

View file

@ -18,11 +18,11 @@ use Friendica\Object\Image;
function fbrowser_content(App $a) function fbrowser_content(App $a)
{ {
if (!local_user()) { if (!local_user()) {
killme(); exit();
} }
if ($a->argc == 1) { if ($a->argc == 1) {
killme(); exit();
} }
$template_file = "filebrowser.tpl"; $template_file = "filebrowser.tpl";
@ -146,6 +146,6 @@ function fbrowser_content(App $a)
return $o; return $o;
} else { } else {
echo $o; echo $o;
killme(); exit();
} }
} }

View file

@ -40,7 +40,7 @@ function fetch_init(App $a)
header("HTTP/1.1 301 Moved Permanently"); header("HTTP/1.1 301 Moved Permanently");
header("Location:".$location); header("Location:".$location);
killme(); exit();
} }
} }
@ -60,5 +60,5 @@ function fetch_init(App $a)
header("Content-Type: application/magic-envelope+xml; charset=utf-8"); header("Content-Type: application/magic-envelope+xml; charset=utf-8");
echo Diaspora::buildMagicEnvelope($xml, $user); echo Diaspora::buildMagicEnvelope($xml, $user);
killme(); exit();
} }

View file

@ -13,7 +13,7 @@ use Friendica\Util\XML;
function filer_content(App $a) function filer_content(App $a)
{ {
if (! local_user()) { if (! local_user()) {
killme(); exit();
} }
$term = XML::unescape(trim(defaults($_GET, 'term', ''))); $term = XML::unescape(trim(defaults($_GET, 'term', '')));
@ -38,5 +38,5 @@ function filer_content(App $a)
echo $o; echo $o;
} }
killme(); exit();
} }

View file

@ -10,7 +10,7 @@ function filerm_content(App $a)
{ {
if (! local_user()) if (! local_user())
{ {
killme(); exit();
} }
$term = XML::unescape(trim($_GET['term'])); $term = XML::unescape(trim($_GET['term']));
@ -37,5 +37,5 @@ function filerm_content(App $a)
} }
$a->internalRedirect('/network?f=&file=' . rawurlencode($term)); $a->internalRedirect('/network?f=&file=' . rawurlencode($term));
killme(); exit();
} }

View file

@ -68,7 +68,7 @@ function friendica_init(App $a)
header('Content-type: application/json; charset=utf-8'); header('Content-type: application/json; charset=utf-8');
echo json_encode($data); echo json_encode($data);
killme(); exit();
} }
} }

View file

@ -307,7 +307,7 @@ function group_content(App $a) {
if ($change) { if ($change) {
$tpl = Renderer::getMarkupTemplate('groupeditor.tpl'); $tpl = Renderer::getMarkupTemplate('groupeditor.tpl');
echo Renderer::replaceMacros($tpl, $context); echo Renderer::replaceMacros($tpl, $context);
killme(); exit();
} }
return Renderer::replaceMacros($tpl, $context); return Renderer::replaceMacros($tpl, $context);

View file

@ -41,7 +41,7 @@ function hovercard_content()
if ($datatype == 'tpl') { if ($datatype == 'tpl') {
$templatecontent = get_template_content('hovercard.tpl'); $templatecontent = get_template_content('hovercard.tpl');
echo $templatecontent; echo $templatecontent;
killme(); exit();
} }
// If a contact is connected the url is internally changed to 'redir/CID'. We need the pure url to search for // If a contact is connected the url is internally changed to 'redir/CID'. We need the pure url to search for

View file

@ -8,7 +8,7 @@ use Friendica\Model\Item;
function ignored_init(App $a) function ignored_init(App $a)
{ {
if (!local_user()) { if (!local_user()) {
killme(); exit();
} }
if ($a->argc > 1) { if ($a->argc > 1) {
@ -16,12 +16,12 @@ function ignored_init(App $a)
} }
if (!$message_id) { if (!$message_id) {
killme(); exit();
} }
$thread = Item::selectFirstThreadForUser(local_user(), ['uid', 'ignored'], ['iid' => $message_id]); $thread = Item::selectFirstThreadForUser(local_user(), ['uid', 'ignored'], ['iid' => $message_id]);
if (!DBA::isResult($thread)) { if (!DBA::isResult($thread)) {
killme(); exit();
} }
// Numeric values are needed for the json output further below // Numeric values are needed for the json output further below
@ -49,5 +49,5 @@ function ignored_init(App $a)
// the json doesn't really matter, it will either be 0 or 1 // the json doesn't really matter, it will either be 0 or 1
echo json_encode($ignored); echo json_encode($ignored);
killme(); exit();
} }

View file

@ -51,7 +51,7 @@ function item_post(App $a) {
drop_items($arr_drop); drop_items($arr_drop);
$json = ['success' => 1]; $json = ['success' => 1];
echo json_encode($json); echo json_encode($json);
killme(); exit();
} }
Addon::callHooks('post_local_start', $_REQUEST); Addon::callHooks('post_local_start', $_REQUEST);
@ -118,7 +118,7 @@ function item_post(App $a) {
if (!empty($_REQUEST['return'])) { if (!empty($_REQUEST['return'])) {
$a->internalRedirect($return_path); $a->internalRedirect($return_path);
} }
killme(); exit();
} }
$parent = $parent_item['id']; $parent = $parent_item['id'];
@ -169,7 +169,7 @@ function item_post(App $a) {
$a->internalRedirect($return_path); $a->internalRedirect($return_path);
} }
killme(); exit();
} }
// Init post instance // Init post instance
@ -280,13 +280,13 @@ function item_post(App $a) {
if (!strlen($body)) { if (!strlen($body)) {
if ($preview) { if ($preview) {
killme(); exit();
} }
info(L10n::t('Empty post discarded.') . EOL); info(L10n::t('Empty post discarded.') . EOL);
if (!empty($_REQUEST['return'])) { if (!empty($_REQUEST['return'])) {
$a->internalRedirect($return_path); $a->internalRedirect($return_path);
} }
killme(); exit();
} }
} }
@ -693,7 +693,7 @@ function item_post(App $a) {
} }
echo json_encode($json); echo json_encode($json);
killme(); exit();
} }
if ($orig_post) { if ($orig_post) {
@ -721,7 +721,7 @@ function item_post(App $a) {
Logger::log('return: ' . $return_path); Logger::log('return: ' . $return_path);
$a->internalRedirect($return_path); $a->internalRedirect($return_path);
} }
killme(); exit();
} else { } else {
$post_id = 0; $post_id = 0;
} }
@ -874,7 +874,7 @@ function item_post_return($baseurl, $api_source, $return_path)
Logger::log('post_json: ' . print_r($json, true), Logger::DEBUG); Logger::log('post_json: ' . print_r($json, true), Logger::DEBUG);
echo json_encode($json); echo json_encode($json);
killme(); exit();
} }
function item_content(App $a) function item_content(App $a)
@ -900,7 +900,7 @@ function item_content(App $a)
if ($a->isAjax()) { if ($a->isAjax()) {
// ajax return: [<item id>, 0 (no perm) | <owner id>] // ajax return: [<item id>, 0 (no perm) | <owner id>]
echo json_encode([intval($a->argv[2]), intval($o)]); echo json_encode([intval($a->argv[2]), intval($o)]);
killme(); exit();
} }
} }

View file

@ -28,7 +28,7 @@ function like_content(App $a) {
$return_path = defaults($_REQUEST, 'return', ''); $return_path = defaults($_REQUEST, 'return', '');
like_content_return($a, $return_path); like_content_return($a, $return_path);
killme(); // NOTREACHED exit();
} }
@ -46,6 +46,4 @@ function like_content_return(App $a, $return_path) {
$a->internalRedirect($return_path . $rand); $a->internalRedirect($return_path . $rand);
} }
killme();
} }

View file

@ -19,11 +19,11 @@ function lockview_content(App $a)
} }
if (!$item_id) { if (!$item_id) {
killme(); exit();
} }
if (!in_array($type, ['item','photo','event'])) { if (!in_array($type, ['item','photo','event'])) {
killme(); exit();
} }
$fields = ['uid', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid']; $fields = ['uid', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid'];
@ -37,14 +37,14 @@ function lockview_content(App $a)
} }
if (!DBA::isResult($item)) { if (!DBA::isResult($item)) {
killme(); exit();
} }
Addon::callHooks('lockview_content', $item); Addon::callHooks('lockview_content', $item);
if ($item['uid'] != local_user()) { if ($item['uid'] != local_user()) {
echo L10n::t('Remote privacy information not available.') . '<br />'; echo L10n::t('Remote privacy information not available.') . '<br />';
killme(); exit();
} }
if (isset($item['private']) if (isset($item['private'])
@ -55,7 +55,7 @@ function lockview_content(App $a)
&& empty($item['deny_gid'])) && empty($item['deny_gid']))
{ {
echo L10n::t('Remote privacy information not available.') . '<br />'; echo L10n::t('Remote privacy information not available.') . '<br />';
killme(); exit();
} }
$allowed_users = expand_acl($item['allow_cid']); $allowed_users = expand_acl($item['allow_cid']);
@ -111,6 +111,6 @@ function lockview_content(App $a)
} }
echo $o . implode(', ', $l); echo $o . implode(', ', $l);
killme(); exit();
} }

View file

@ -24,5 +24,5 @@ function manifest_content(App $a) {
echo $o; echo $o;
killme(); exit();
} }

View file

@ -6,7 +6,7 @@ use Friendica\Database\DBA;
function modexp_init(App $a) { function modexp_init(App $a) {
if($a->argc != 2) if($a->argc != 2)
killme(); exit();
$nick = $a->argv[1]; $nick = $a->argv[1];
$r = q("SELECT `spubkey` FROM `user` WHERE `nickname` = '%s' LIMIT 1", $r = q("SELECT `spubkey` FROM `user` WHERE `nickname` = '%s' LIMIT 1",
@ -14,7 +14,7 @@ function modexp_init(App $a) {
); );
if (! DBA::isResult($r)) { if (! DBA::isResult($r)) {
killme(); exit();
} }
$lines = explode("\n",$r[0]['spubkey']); $lines = explode("\n",$r[0]['spubkey']);
@ -30,7 +30,7 @@ function modexp_init(App $a) {
header("Content-type: application/magic-public-key"); header("Content-type: application/magic-public-key");
echo 'RSA' . '.' . $m . '.' . $e; echo 'RSA' . '.' . $m . '.' . $e;
killme(); exit();
} }

View file

@ -625,7 +625,7 @@ function networkThreadedView(App $a, $update, $parent)
$group = DBA::selectFirst('group', ['name'], ['id' => $gid, 'uid' => local_user()]); $group = DBA::selectFirst('group', ['name'], ['id' => $gid, 'uid' => local_user()]);
if (!DBA::isResult($group)) { if (!DBA::isResult($group)) {
if ($update) { if ($update) {
killme(); exit();
} }
notice(L10n::t('No such group') . EOL); notice(L10n::t('No such group') . EOL);
$a->internalRedirect('network/0'); $a->internalRedirect('network/0');

View file

@ -24,12 +24,10 @@ function nodeinfo_wellknown(App $a) {
function nodeinfo_init(App $a) { function nodeinfo_init(App $a) {
if (!Config::get('system', 'nodeinfo')) { if (!Config::get('system', 'nodeinfo')) {
System::httpExit(404); System::httpExit(404);
killme();
} }
if (($a->argc != 2) || ($a->argv[1] != '1.0')) { if (($a->argc != 2) || ($a->argv[1] != '1.0')) {
System::httpExit(404); System::httpExit(404);
killme();
} }
$smtp = (function_exists('imap_open') && !Config::get('system', 'imap_disabled') && !Config::get('system', 'dfrn_only')); $smtp = (function_exists('imap_open') && !Config::get('system', 'imap_disabled') && !Config::get('system', 'dfrn_only'));
@ -149,7 +147,6 @@ function nodeinfo_cron() {
$addon = 'statistics_json'; $addon = 'statistics_json';
$addons = Config::get('system', 'addon'); $addons = Config::get('system', 'addon');
$addons_arr = [];
if ($addons) { if ($addons) {
$addons_arr = explode(',',str_replace(' ', '',$addons)); $addons_arr = explode(',',str_replace(' ', '',$addons));

View file

@ -15,7 +15,7 @@ function noscrape_init(App $a)
if ($a->argc > 1) { if ($a->argc > 1) {
$which = $a->argv[1]; $which = $a->argv[1];
} else { } else {
killme(); exit();
} }
$profile = 0; $profile = 0;

View file

@ -48,7 +48,7 @@ function notify_init(App $a)
$r = $nm->setAllSeen(); $r = $nm->setAllSeen();
$j = json_encode(['result' => ($r) ? 'success' : 'fail']); $j = json_encode(['result' => ($r) ? 'success' : 'fail']);
echo $j; echo $j;
killme(); exit();
} }
} }

View file

@ -17,7 +17,7 @@ function oexchange_init(App $a) {
$o = Renderer::replaceMacros($tpl, ['$base' => System::baseUrl()]); $o = Renderer::replaceMacros($tpl, ['$base' => System::baseUrl()]);
echo $o; echo $o;
killme(); exit();
} }
} }

View file

@ -17,5 +17,5 @@ function opensearch_content(App $a) {
echo $o; echo $o;
killme(); exit();
} }

View file

@ -185,7 +185,7 @@ function photos_post(App $a)
if (!$can_post) { if (!$can_post) {
notice(L10n::t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
killme(); exit();
} }
$owner_record = User::getOwnerDataById($page_owner_uid); $owner_record = User::getOwnerDataById($page_owner_uid);
@ -193,7 +193,7 @@ function photos_post(App $a)
if (!$owner_record) { if (!$owner_record) {
notice(L10n::t('Contact information unavailable') . EOL); notice(L10n::t('Contact information unavailable') . EOL);
Logger::log('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid); Logger::log('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid);
killme(); exit();
} }
if ($a->argc > 3 && $a->argv[2] === 'album') { if ($a->argc > 3 && $a->argv[2] === 'album') {
@ -794,7 +794,7 @@ function photos_post(App $a)
@unlink($src); @unlink($src);
$foo = 0; $foo = 0;
Addon::callHooks('photo_post_end',$foo); Addon::callHooks('photo_post_end',$foo);
killme(); exit();
} }
$exif = $image->orient($src); $exif = $image->orient($src);
@ -820,7 +820,7 @@ function photos_post(App $a)
if (!$r) { if (!$r) {
Logger::log('mod/photos.php: photos_post(): image store failed', Logger::DEBUG); Logger::log('mod/photos.php: photos_post(): image store failed', Logger::DEBUG);
notice(L10n::t('Image upload failed.') . EOL); notice(L10n::t('Image upload failed.') . EOL);
killme(); exit();
} }
if ($width > 640 || $height > 640) { if ($width > 640 || $height > 640) {

View file

@ -10,5 +10,5 @@ function phpinfo_content()
} }
phpinfo(); phpinfo();
killme(); exit();
} }

View file

@ -115,7 +115,7 @@ function ping_init(App $a)
header("Content-type: text/xml"); header("Content-type: text/xml");
echo XML::fromArray($data, $xml); echo XML::fromArray($data, $xml);
} }
killme(); exit();
} }
$notifs = ping_get_notifications(local_user()); $notifs = ping_get_notifications(local_user());
@ -386,7 +386,7 @@ function ping_init(App $a)
echo XML::fromArray(["result" => $data], $xml); echo XML::fromArray(["result" => $data], $xml);
} }
killme(); exit();
} }
/** /**

View file

@ -46,7 +46,7 @@ function poco_init(App $a) {
$ret = PortableContact::serverlist(); $ret = PortableContact::serverlist();
header('Content-type: application/json'); header('Content-type: application/json');
echo json_encode($ret); echo json_encode($ret);
killme(); exit();
} }
if ($a->argc > 1 && $a->argv[1] === '@global') { if ($a->argc > 1 && $a->argv[1] === '@global') {
@ -378,12 +378,12 @@ function poco_init(App $a) {
if ($format === 'xml') { if ($format === 'xml') {
header('Content-type: text/xml'); header('Content-type: text/xml');
echo Renderer::replaceMacros(Renderer::getMarkupTemplate('poco_xml.tpl'), XML::arrayEscape(['$response' => $ret])); echo Renderer::replaceMacros(Renderer::getMarkupTemplate('poco_xml.tpl'), XML::arrayEscape(['$response' => $ret]));
killme(); exit();
} }
if ($format === 'json') { if ($format === 'json') {
header('Content-type: application/json'); header('Content-type: application/json');
echo json_encode($ret); echo json_encode($ret);
killme(); exit();
} else { } else {
System::httpExit(500); System::httpExit(500);
} }

View file

@ -21,5 +21,5 @@ function pretheme_init(App $a) {
echo json_encode(['img' => Theme::getScreenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits]); echo json_encode(['img' => Theme::getScreenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits]);
} }
killme(); exit();
} }

View file

@ -12,7 +12,7 @@ function probe_content(App $a)
if (!local_user()) { if (!local_user()) {
System::httpExit(403, ["title" => L10n::t("Public access denied."), System::httpExit(403, ["title" => L10n::t("Public access denied."),
"description" => L10n::t("Only logged in users are permitted to perform a probing.")]); "description" => L10n::t("Only logged in users are permitted to perform a probing.")]);
killme(); exit();
} }
$o = '<div class="generic-page-wrapper">'; $o = '<div class="generic-page-wrapper">';

View file

@ -117,7 +117,7 @@ function profiles_init(App $a) {
); );
if(! DBA::isResult($r1)) { if(! DBA::isResult($r1)) {
notice(L10n::t('Profile unavailable to clone.') . EOL); notice(L10n::t('Profile unavailable to clone.') . EOL);
killme(); exit();
return; return;
} }
unset($r1[0]['id']); unset($r1[0]['id']);
@ -150,7 +150,7 @@ function profiles_init(App $a) {
); );
if (! DBA::isResult($r)) { if (! DBA::isResult($r)) {
notice(L10n::t('Profile not found.') . EOL); notice(L10n::t('Profile not found.') . EOL);
killme(); exit();
return; return;
} }

View file

@ -165,7 +165,7 @@ function profperm_content(App $a) {
if (!empty($change)) { if (!empty($change)) {
echo $o; echo $o;
killme(); exit();
} }
$o .= '</div>'; $o .= '</div>';
return $o; return $o;

View file

@ -17,7 +17,7 @@ function hub_return($valid, $body)
} else { } else {
System::httpExit(404); System::httpExit(404);
} }
killme(); exit();
} }
// when receiving an XML feed, always return OK // when receiving an XML feed, always return OK

View file

@ -136,5 +136,5 @@ function pubsubhubbub_init(App $a) {
System::httpExit(202); System::httpExit(202);
} }
killme(); exit();
} }

View file

@ -26,5 +26,5 @@ function robots_txt_init(App $a)
foreach ($allDisalloweds as $disallowed) { foreach ($allDisalloweds as $disallowed) {
echo 'Disallow: ' . $disallowed . PHP_EOL; echo 'Disallow: ' . $disallowed . PHP_EOL;
} }
killme(); exit();
} }

View file

@ -22,5 +22,5 @@ function rsd_xml_content(App $a)
</service> </service>
</rsd>'; </rsd>';
killme(); exit();
} }

View file

@ -102,7 +102,7 @@ function search_content(App $a) {
System::httpExit(403, System::httpExit(403,
["title" => L10n::t("Public access denied."), ["title" => L10n::t("Public access denied."),
"description" => L10n::t("Only logged in users are permitted to perform a search.")]); "description" => L10n::t("Only logged in users are permitted to perform a search.")]);
killme(); exit();
//notice(L10n::t('Public access denied.').EOL); //notice(L10n::t('Public access denied.').EOL);
//return; //return;
} }
@ -127,7 +127,7 @@ function search_content(App $a) {
System::httpExit(429, System::httpExit(429,
["title" => L10n::t("Too Many Requests"), ["title" => L10n::t("Too Many Requests"),
"description" => L10n::t("Only one search per minute is permitted for not logged in users.")]); "description" => L10n::t("Only one search per minute is permitted for not logged in users.")]);
killme(); exit();
} }
Cache::set("remote_search:".$remote, json_encode(["time" => time(), "accesses" => $resultdata->accesses + 1]), Cache::HOUR); Cache::set("remote_search:".$remote, json_encode(["time" => time(), "accesses" => $resultdata->accesses + 1]), Cache::HOUR);
} else } else

View file

@ -8,7 +8,7 @@ function share_init(App $a) {
$post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0); $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
if (!$post_id || !local_user()) { if (!$post_id || !local_user()) {
killme(); exit();
} }
$fields = ['private', 'body', 'author-name', 'author-link', 'author-avatar', $fields = ['private', 'body', 'author-name', 'author-link', 'author-avatar',
@ -16,7 +16,7 @@ function share_init(App $a) {
$item = Item::selectFirst($fields, ['id' => $post_id]); $item = Item::selectFirst($fields, ['id' => $post_id]);
if (!DBA::isResult($item) || $item['private'] == 1) { if (!DBA::isResult($item) || $item['private'] == 1) {
killme(); exit();
} }
if (strpos($item['body'], "[/share]") !== false) { if (strpos($item['body'], "[/share]") !== false) {
@ -34,7 +34,7 @@ function share_init(App $a) {
} }
echo $o; echo $o;
killme(); exit();
} }
/// @TODO Rewrite to handle over whole record array /// @TODO Rewrite to handle over whole record array

View file

@ -12,18 +12,18 @@ function starred_init(App $a) {
$message_id = null; $message_id = null;
if (!local_user()) { if (!local_user()) {
killme(); exit();
} }
if ($a->argc > 1) { if ($a->argc > 1) {
$message_id = intval($a->argv[1]); $message_id = intval($a->argv[1]);
} }
if (!$message_id) { if (!$message_id) {
killme(); exit();
} }
$item = Item::selectFirstForUser(local_user(), ['starred'], ['uid' => local_user(), 'id' => $message_id]); $item = Item::selectFirstForUser(local_user(), ['starred'], ['uid' => local_user(), 'id' => $message_id]);
if (!DBA::isResult($item)) { if (!DBA::isResult($item)) {
killme(); exit();
} }
if (!intval($item['starred'])) { if (!intval($item['starred'])) {
@ -48,5 +48,5 @@ function starred_init(App $a) {
// the json doesn't really matter, it will either be 0 or 1 // the json doesn't really matter, it will either be 0 or 1
echo json_encode($starred); echo json_encode($starred);
killme(); exit();
} }

View file

@ -14,7 +14,6 @@ function statistics_json_init(App $a) {
if (!Config::get("system", "nodeinfo")) { if (!Config::get("system", "nodeinfo")) {
System::httpExit(404); System::httpExit(404);
killme();
} }
$statistics = [ $statistics = [
@ -56,5 +55,5 @@ function statistics_json_init(App $a) {
header("Content-Type: application/json"); header("Content-Type: application/json");
echo json_encode($statistics, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); echo json_encode($statistics, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
Logger::log("statistics_init: printed " . print_r($statistics, true), Logger::DATA); Logger::log("statistics_init: printed " . print_r($statistics, true), Logger::DATA);
killme(); exit();
} }

View file

@ -151,6 +151,6 @@ EOT;
Addon::callHooks('post_local_end', $arr); Addon::callHooks('post_local_end', $arr);
killme(); exit();
} }

View file

@ -203,7 +203,5 @@ EOT;
Worker::add(PRIORITY_HIGH, "Notifier", "tag", $post_id); Worker::add(PRIORITY_HIGH, "Notifier", "tag", $post_id);
killme(); exit();
return; // NOTREACHED
} }

View file

@ -11,7 +11,7 @@ use Friendica\Database\DBA;
function uexport_init(App $a) { function uexport_init(App $a) {
if (!local_user()) { if (!local_user()) {
killme(); exit();
} }
require_once("mod/settings.php"); require_once("mod/settings.php");
@ -26,14 +26,14 @@ function uexport_content(App $a) {
switch ($a->argv[1]) { switch ($a->argv[1]) {
case "backup": case "backup":
uexport_all($a); uexport_all($a);
killme(); exit();
break; break;
case "account": case "account":
uexport_account($a); uexport_account($a);
killme(); exit();
break; break;
default: default:
killme(); exit();
} }
} }
@ -130,7 +130,6 @@ function uexport_account($a) {
'group_member' => $group_member, 'group_member' => $group_member,
]; ];
//echo "<pre>"; var_dump(json_encode($output)); killme();
echo json_encode($output, JSON_PARTIAL_OUTPUT_ON_ERROR); echo json_encode($output, JSON_PARTIAL_OUTPUT_ON_ERROR);
} }
@ -152,7 +151,6 @@ function uexport_all(App $a) {
// chunk the output to avoid exhausting memory // chunk the output to avoid exhausting memory
for ($x = 0; $x < $total; $x += 500) { for ($x = 0; $x < $total; $x += 500) {
$item = [];
$r = q("SELECT * FROM `item` WHERE `uid` = %d LIMIT %d, %d", $r = q("SELECT * FROM `item` WHERE `uid` = %d LIMIT %d, %d",
intval(local_user()), intval(local_user()),
intval($x), intval($x),

View file

@ -34,5 +34,5 @@ function update_community_content(App $a) {
echo str_replace("\t", " ", $text); echo str_replace("\t", " ", $text);
echo "</section>"; echo "</section>";
echo "</body></html>\r\n"; echo "</body></html>\r\n";
killme(); exit();
} }

View file

@ -34,5 +34,5 @@ function update_contact_content(App $a)
echo str_replace("\t", " ", $text); echo str_replace("\t", " ", $text);
echo "</section>"; echo "</section>";
echo "</body></html>\r\n"; echo "</body></html>\r\n";
killme(); exit();
} }

View file

@ -35,5 +35,5 @@ function update_display_content(App $a)
echo str_replace("\t", " ", $text); echo str_replace("\t", " ", $text);
echo "</section>"; echo "</section>";
echo "</body></html>\r\n"; echo "</body></html>\r\n";
killme(); exit();
} }

View file

@ -13,7 +13,7 @@ require_once "mod/network.php";
function update_network_content(App $a) function update_network_content(App $a)
{ {
if (!isset($_GET['p']) || !isset($_GET['item'])) { if (!isset($_GET['p']) || !isset($_GET['item'])) {
killme(); exit();
} }
$profile_uid = intval($_GET['p']); $profile_uid = intval($_GET['p']);
@ -44,5 +44,5 @@ function update_network_content(App $a)
echo str_replace("\t", " ", $text); echo str_replace("\t", " ", $text);
echo "</section>"; echo "</section>";
echo "</body></html>\r\n"; echo "</body></html>\r\n";
killme(); exit();
} }

View file

@ -48,5 +48,5 @@ function update_notes_content(App $a) {
echo str_replace("\t", " ", $text); echo str_replace("\t", " ", $text);
echo "</section>"; echo "</section>";
echo "</body></html>\r\n"; echo "</body></html>\r\n";
killme(); exit();
} }

View file

@ -47,5 +47,5 @@ function update_profile_content(App $a) {
echo str_replace("\t", " ", $text); echo str_replace("\t", " ", $text);
echo "</section>"; echo "</section>";
echo "</body></html>\r\n"; echo "</body></html>\r\n";
killme(); exit();
} }

View file

@ -13,5 +13,5 @@ function view_init($a){
require_once("view/theme/$theme/style.php"); require_once("view/theme/$theme/style.php");
} }
killme(); exit();
} }

View file

@ -28,7 +28,7 @@ function viewsrc_content(App $a)
if (DBA::isResult($item)) { if (DBA::isResult($item)) {
if ($a->isAjax()) { if ($a->isAjax()) {
echo str_replace("\n", '<br />', $item['body']); echo str_replace("\n", '<br />', $item['body']);
killme(); exit();
} else { } else {
$o .= str_replace("\n", '<br />', $item['body']); $o .= str_replace("\n", '<br />', $item['body']);
} }

View file

@ -26,14 +26,14 @@ function wall_attach_post(App $a) {
if (! DBA::isResult($r)) { if (! DBA::isResult($r)) {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]); echo json_encode(['error' => L10n::t('Invalid request.')]);
killme(); exit();
} }
return; return;
} }
} else { } else {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]); echo json_encode(['error' => L10n::t('Invalid request.')]);
killme(); exit();
} }
return; return;
@ -79,17 +79,17 @@ function wall_attach_post(App $a) {
if (! $can_post) { if (! $can_post) {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => L10n::t('Permission denied.')]); echo json_encode(['error' => L10n::t('Permission denied.')]);
killme(); exit();
} }
notice(L10n::t('Permission denied.') . EOL ); notice(L10n::t('Permission denied.') . EOL );
killme(); exit();
} }
if (empty($_FILES['userfile'])) { if (empty($_FILES['userfile'])) {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]); echo json_encode(['error' => L10n::t('Invalid request.')]);
} }
killme(); exit();
} }
$src = $_FILES['userfile']['tmp_name']; $src = $_FILES['userfile']['tmp_name'];
@ -112,7 +112,7 @@ function wall_attach_post(App $a) {
notice($msg . EOL); notice($msg . EOL);
} }
@unlink($src); @unlink($src);
killme(); exit();
} }
if ($maxfilesize && $filesize > $maxfilesize) { if ($maxfilesize && $filesize > $maxfilesize) {
@ -123,7 +123,7 @@ function wall_attach_post(App $a) {
echo $msg . EOL; echo $msg . EOL;
} }
@unlink($src); @unlink($src);
killme(); exit();
} }
$filedata = @file_get_contents($src); $filedata = @file_get_contents($src);
@ -146,7 +146,7 @@ function wall_attach_post(App $a) {
} else { } else {
echo $msg . EOL; echo $msg . EOL;
} }
killme(); exit();
} }
$r = q("SELECT `id` FROM `attach` WHERE `uid` = %d AND `created` = '%s' AND `hash` = '%s' LIMIT 1", $r = q("SELECT `id` FROM `attach` WHERE `uid` = %d AND `created` = '%s' AND `hash` = '%s' LIMIT 1",
@ -162,18 +162,18 @@ function wall_attach_post(App $a) {
} else { } else {
echo $msg . EOL; echo $msg . EOL;
} }
killme(); exit();
} }
if ($r_json) { if ($r_json) {
echo json_encode(['ok' => true]); echo json_encode(['ok' => true]);
killme(); exit();
} }
$lf = "\n"; $lf = "\n";
echo $lf . $lf . '[attachment]' . $r[0]['id'] . '[/attachment]' . $lf; echo $lf . $lf . '[attachment]' . $r[0]['id'] . '[/attachment]' . $lf;
killme(); exit();
// NOTREACHED // NOTREACHED
} }

View file

@ -39,7 +39,7 @@ function wall_upload_post(App $a, $desktopmode = true)
if (!DBA::isResult($r)) { if (!DBA::isResult($r)) {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]); echo json_encode(['error' => L10n::t('Invalid request.')]);
killme(); exit();
} }
return; return;
} }
@ -55,7 +55,7 @@ function wall_upload_post(App $a, $desktopmode = true)
} else { } else {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]); echo json_encode(['error' => L10n::t('Invalid request.')]);
killme(); exit();
} }
return; return;
} }
@ -104,17 +104,17 @@ function wall_upload_post(App $a, $desktopmode = true)
if (!$can_post) { if (!$can_post) {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => L10n::t('Permission denied.')]); echo json_encode(['error' => L10n::t('Permission denied.')]);
killme(); exit();
} }
notice(L10n::t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
killme(); exit();
} }
if (empty($_FILES['userfile']) && empty($_FILES['media'])) { if (empty($_FILES['userfile']) && empty($_FILES['media'])) {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]); echo json_encode(['error' => L10n::t('Invalid request.')]);
} }
killme(); exit();
} }
$src = ''; $src = '';
@ -164,10 +164,10 @@ function wall_upload_post(App $a, $desktopmode = true)
if ($src == "") { if ($src == "") {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]); echo json_encode(['error' => L10n::t('Invalid request.')]);
killme(); exit();
} }
notice(L10n::t('Invalid request.').EOL); notice(L10n::t('Invalid request.').EOL);
killme(); exit();
} }
// This is a special treatment for picture upload from Twidere // This is a special treatment for picture upload from Twidere
@ -201,7 +201,7 @@ function wall_upload_post(App $a, $desktopmode = true)
echo $msg. EOL; echo $msg. EOL;
} }
@unlink($src); @unlink($src);
killme(); exit();
} }
$imagedata = @file_get_contents($src); $imagedata = @file_get_contents($src);
@ -215,7 +215,7 @@ function wall_upload_post(App $a, $desktopmode = true)
echo $msg. EOL; echo $msg. EOL;
} }
@unlink($src); @unlink($src);
killme(); exit();
} }
$Image->orient($src); $Image->orient($src);
@ -253,7 +253,7 @@ function wall_upload_post(App $a, $desktopmode = true)
} else { } else {
echo $msg. EOL; echo $msg. EOL;
} }
killme(); exit();
} }
if ($width > 640 || $height > 640) { if ($width > 640 || $height > 640) {
@ -283,7 +283,7 @@ function wall_upload_post(App $a, $desktopmode = true)
if (!$r) { if (!$r) {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => '']); echo json_encode(['error' => '']);
killme(); exit();
} }
return false; return false;
} }
@ -300,7 +300,7 @@ function wall_upload_post(App $a, $desktopmode = true)
if ($r_json) { if ($r_json) {
echo json_encode(['picture' => $picture]); echo json_encode(['picture' => $picture]);
killme(); exit();
} }
Logger::log("upload done", Logger::DEBUG); Logger::log("upload done", Logger::DEBUG);
return $picture; return $picture;
@ -310,10 +310,10 @@ function wall_upload_post(App $a, $desktopmode = true)
if ($r_json) { if ($r_json) {
echo json_encode(['ok' => true]); echo json_encode(['ok' => true]);
killme(); exit();
} }
echo "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . System::baseUrl() . "/photo/{$hash}-{$smallest}.".$Image->getExt()."[/img][/url]\n\n"; echo "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . System::baseUrl() . "/photo/{$hash}-{$smallest}.".$Image->getExt()."[/img][/url]\n\n";
killme(); exit();
// NOTREACHED // NOTREACHED
} }

View file

@ -17,7 +17,7 @@ function webfinger_content(App $a)
"description" => L10n::t("Only logged in users are permitted to perform a probing.") "description" => L10n::t("Only logged in users are permitted to perform a probing.")
] ]
); );
killme(); exit();
} }
$o = '<div class="generic-page-wrapper">'; $o = '<div class="generic-page-wrapper">';

View file

@ -58,5 +58,5 @@ function worker_init()
Logger::log("Front end worker ended: ".getmypid()); Logger::log("Front end worker ended: ".getmypid());
killme(); exit();
} }

View file

@ -97,7 +97,7 @@ function xrd_json($a, $uri, $alias, $profile_url, $r)
]; ];
echo json_encode($json); echo json_encode($json);
killme(); exit();
} }
function xrd_xml($a, $uri, $alias, $profile_url, $r) function xrd_xml($a, $uri, $alias, $profile_url, $r)
@ -130,5 +130,5 @@ function xrd_xml($a, $uri, $alias, $profile_url, $r)
Addon::callHooks('personal_xrd', $arr); Addon::callHooks('personal_xrd', $arr);
echo $arr['xml']; echo $arr['xml'];
killme(); exit();
} }

View file

@ -150,8 +150,8 @@ abstract class BaseModule extends BaseObject
$a = \get_app(); $a = \get_app();
Logger::log('checkFormSecurityToken failed: user ' . $a->user['guid'] . ' - form element ' . $typename); Logger::log('checkFormSecurityToken failed: user ' . $a->user['guid'] . ' - form element ' . $typename);
Logger::log('checkFormSecurityToken failed: _REQUEST data: ' . print_r($_REQUEST, true), Logger::DATA); Logger::log('checkFormSecurityToken failed: _REQUEST data: ' . print_r($_REQUEST, true), Logger::DATA);
header('HTTP/1.1 403 Forbidden');
killme(); System::httpExit(403);
} }
} }
} }

View file

@ -96,7 +96,7 @@ class Renderer extends BaseObject
$template = $t->getTemplateFile($s, $root); $template = $t->getTemplateFile($s, $root);
} catch (Exception $e) { } catch (Exception $e) {
echo "<pre><b>" . __FUNCTION__ . "</b>: " . $e->getMessage() . "</pre>"; echo "<pre><b>" . __FUNCTION__ . "</b>: " . $e->getMessage() . "</pre>";
killme(); exit();
} }
$a->saveTimestamp($stamp1, "file"); $a->saveTimestamp($stamp1, "file");

View file

@ -111,7 +111,7 @@ class System extends BaseObject
echo XML::fromArray($xmldata, $xml); echo XML::fromArray($xmldata, $xml);
killme(); exit();
} }
/** /**
@ -185,7 +185,7 @@ class System extends BaseObject
public static function jsonExit($x, $content_type = 'application/json') { public static function jsonExit($x, $content_type = 'application/json') {
header("Content-type: $content_type"); header("Content-type: $content_type");
echo json_encode($x); echo json_encode($x);
killme(); exit();
} }
/** /**

View file

@ -25,14 +25,14 @@ class Oembed extends BaseModule
if ($a->argv[1] == 'b2h') { if ($a->argv[1] == 'b2h') {
$url = ["", trim(hex2bin($_REQUEST['url']))]; $url = ["", trim(hex2bin($_REQUEST['url']))];
echo Content\OEmbed::replaceCallback($url); echo Content\OEmbed::replaceCallback($url);
killme(); exit();
} }
// Unused form: /oembed/h2b?text=... // Unused form: /oembed/h2b?text=...
if ($a->argv[1] == 'h2b') { if ($a->argv[1] == 'h2b') {
$text = trim(hex2bin($_REQUEST['text'])); $text = trim(hex2bin($_REQUEST['text']));
echo Content\OEmbed::HTML2BBCode($text); echo Content\OEmbed::HTML2BBCode($text);
killme(); exit();
} }
if ($a->argc == 2) { if ($a->argc == 2) {
@ -49,6 +49,6 @@ class Oembed extends BaseModule
echo $j->html; echo $j->html;
echo '</body></html>'; echo '</body></html>';
} }
killme(); exit();
} }
} }

View file

@ -20,7 +20,6 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
*/ */
class Photo extends BaseModule class Photo extends BaseModule
{ {
/** /**
* @brief Module initializer * @brief Module initializer
* *
@ -78,7 +77,7 @@ class Photo extends BaseModule
if ($photo === false) { if ($photo === false) {
// not using System::httpExit() because we don't want html here. // not using System::httpExit() because we don't want html here.
header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found" , true, 404); header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found" , true, 404);
killme(); exit();
} }
$cacheable = ($photo["allow_cid"] . $photo["allow_gid"] . $photo["deny_cid"] . $photo["deny_gid"] === "") && (isset($photo["cacheable"]) ? $photo["cacheable"] : true); $cacheable = ($photo["allow_cid"] . $photo["allow_gid"] . $photo["deny_cid"] . $photo["deny_gid"] === "") && (isset($photo["cacheable"]) ? $photo["cacheable"] : true);
@ -90,13 +89,11 @@ class Photo extends BaseModule
System::httpExit(500, ["description" => "Invalid photo with id {$photo["id"]}."]); System::httpExit(500, ["description" => "Invalid photo with id {$photo["id"]}."]);
} }
// if customsize is set and image is not a gif, resize it // if customsize is set and image is not a gif, resize it
if ($img->getType() !== "image/gif" && $customsize > 0 && $customsize < 501) { if ($img->getType() !== "image/gif" && $customsize > 0 && $customsize < 501) {
$img->scaleToSquare($customsize); $img->scaleToSquare($customsize);
} }
if (function_exists("header_remove")) { if (function_exists("header_remove")) {
header_remove("Pragma"); header_remove("Pragma");
header_remove("pragma"); header_remove("pragma");
@ -117,11 +114,9 @@ class Photo extends BaseModule
header("Cache-Control: max-age=31536000"); header("Cache-Control: max-age=31536000");
} }
echo $img->asString(); echo $img->asString();
exit();
killme();
} }
private static function stripExtension($name) private static function stripExtension($name)

View file

@ -171,7 +171,7 @@ class DFRN
if (! DBA::isResult($r)) { if (! DBA::isResult($r)) {
Logger::log(sprintf('No contact found for nickname=%d', $owner_nick), Logger::WARNING); Logger::log(sprintf('No contact found for nickname=%d', $owner_nick), Logger::WARNING);
killme(); exit();
} }
$owner = $r[0]; $owner = $r[0];
@ -207,7 +207,7 @@ class DFRN
if (! DBA::isResult($r)) { if (! DBA::isResult($r)) {
Logger::log(sprintf('No contact found for uid=%d', $owner_id), Logger::WARNING); Logger::log(sprintf('No contact found for uid=%d', $owner_id), Logger::WARNING);
killme(); exit();
} }
$contact = $r[0]; $contact = $r[0];
@ -353,7 +353,7 @@ class DFRN
$ret = Item::select(Item::DELIVER_FIELDLIST, $condition); $ret = Item::select(Item::DELIVER_FIELDLIST, $condition);
$items = Item::inArray($ret); $items = Item::inArray($ret);
if (!DBA::isResult($items)) { if (!DBA::isResult($items)) {
killme(); exit();
} }
$item = $items[0]; $item = $items[0];
@ -361,7 +361,7 @@ class DFRN
if ($item['uid'] != 0) { if ($item['uid'] != 0) {
$owner = User::getOwnerDataById($item['uid']); $owner = User::getOwnerDataById($item['uid']);
if (!$owner) { if (!$owner) {
killme(); exit();
} }
} else { } else {
$owner = ['uid' => 0, 'nick' => 'feed-item']; $owner = ['uid' => 0, 'nick' => 'feed-item'];
@ -1962,7 +1962,7 @@ class DFRN
*/ */
if (!DBA::isResult($fcontact)) { if (!DBA::isResult($fcontact)) {
// Database record did not get created. Quietly give up. // Database record did not get created. Quietly give up.
killme(); exit();
} }
$fid = $r[0]["id"]; $fid = $r[0]["id"];

View file

@ -19,7 +19,7 @@ class FriendicaSmartyEngine implements ITemplateEngine
{ {
if (!is_writable('view/smarty3/')) { if (!is_writable('view/smarty3/')) {
echo "<b>ERROR:</b> folder <tt>view/smarty3/</tt> must be writable by webserver."; echo "<b>ERROR:</b> folder <tt>view/smarty3/</tt> must be writable by webserver.";
killme(); exit();
} }
} }

View file

@ -88,8 +88,9 @@ class Emailer
'headers' => $messageHeader, 'headers' => $messageHeader,
'parameters' => $sendmail_params 'parameters' => $sendmail_params
]; ];
//echo "<pre>"; var_dump($hookdata); killme();
Addon::callHooks("emailer_send", $hookdata); Addon::callHooks("emailer_send", $hookdata);
$res = mail( $res = mail(
$hookdata['to'], $hookdata['to'],
$hookdata['subject'], $hookdata['subject'],

View file

@ -151,7 +151,7 @@ class Cron
$restart = true; $restart = true;
$generation = intval($generation); $generation = intval($generation);
if (!$generation) { if (!$generation) {
killme(); exit();
} }
} }