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

@ -150,8 +150,8 @@ abstract class BaseModule extends BaseObject
$a = \get_app();
Logger::log('checkFormSecurityToken failed: user ' . $a->user['guid'] . ' - form element ' . $typename);
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);
} catch (Exception $e) {
echo "<pre><b>" . __FUNCTION__ . "</b>: " . $e->getMessage() . "</pre>";
killme();
exit();
}
$a->saveTimestamp($stamp1, "file");

View file

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

View file

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

View file

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

View file

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

View file

@ -19,7 +19,7 @@ class FriendicaSmartyEngine implements ITemplateEngine
{
if (!is_writable('view/smarty3/')) {
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,
'parameters' => $sendmail_params
];
//echo "<pre>"; var_dump($hookdata); killme();
Addon::callHooks("emailer_send", $hookdata);
$res = mail(
$hookdata['to'],
$hookdata['subject'],

View file

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